-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c305c6
commit df34e66
Showing
17 changed files
with
117 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,32 @@ | ||
from typing import Any | ||
from unittest import mock | ||
|
||
from django.test.runner import DiscoverRunner | ||
from xmlrunner.extra.djangotestrunner import XMLTestRunner | ||
|
||
|
||
def check_wharton(*args) -> bool: | ||
def check_wharton(*args: Any) -> bool: | ||
return False | ||
|
||
|
||
class MockLabsAnalytics: | ||
|
||
def __init__(self): | ||
def __init__(self) -> None: | ||
pass | ||
|
||
def submit(self, txn): | ||
def submit(self, txn: Any) -> None: | ||
pass | ||
|
||
|
||
class MobileTestCIRunner(XMLTestRunner): | ||
@mock.patch("analytics.analytics.LabsAnalytics", MockLabsAnalytics) | ||
@mock.patch("gsr_booking.models.GroupMembership.check_wharton", check_wharton) | ||
def run_tests(self, test_labels, **kwargs) -> None: | ||
def run_tests(self, test_labels: list[str], **kwargs: Any) -> int: | ||
return super().run_tests(test_labels, **kwargs) | ||
|
||
|
||
class MobileTestLocalRunner(DiscoverRunner): | ||
@mock.patch("analytics.analytics.LabsAnalytics", MockLabsAnalytics) | ||
@mock.patch("gsr_booking.models.GroupMembership.check_wharton", check_wharton) | ||
def run_tests(self, test_labels, **kwargs) -> None: | ||
def run_tests(self, test_labels: list[str], **kwargs: Any) -> int: | ||
return super().run_tests(test_labels, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.