-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update django.test.runner
stubs
#1888
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
) -> Iterator[TestCase]: ... | ||
def reorder_tests( | ||
tests: list[TestCase], classes: tuple[type[TestCase], ...], reverse: bool = ..., shuffler: Shuffler | None = ... | ||
) -> Iterator[TestCase]: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use Iterator
here and Generator
in iter_test_cases
? They should be similar
@@ -159,12 +182,23 @@ class DiscoverRunner: | |||
def get_databases(self, suite: TestSuite) -> set[str]: ... | |||
def run_tests(self, test_labels: list[str], extra_tests: list[Any] | None = ..., **kwargs: Any) -> int: ... | |||
|
|||
def is_discoverable(label: str) -> bool: ... | |||
def try_importing(label: str) -> bool: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It returns tuple[bool, bool]
: https://github.com/django/django/blob/14917c9ae272f47d23401100faa6cefa8e1728bf/django/test/runner.py#L1097
|
||
class DiscoverRunner: | ||
test_suite: type[TestSuite] | ||
parallel_test_suite: type[ParallelTestSuite] | ||
test_runner: type[TextTestRunner] | ||
test_loader: TestLoader | ||
reorder_by: tuple[SimpleTestCase, ...] | ||
reorder_by: tuple[type[TestCase], type[SimpleTestCase]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it should be tuple[type[X], ...]
, where X
is a proper type name.
Why? Because it would be easier to subclass and change. Or maybe even Iterable
/ Sequence
.
|
||
class ParallelTestSuite(TestSuite): | ||
init_worker: Any | ||
process_setup: Callable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we type it better?
|
||
class RemoteTestResult: | ||
events: list[Any] | ||
failfast: bool | ||
shouldStop: bool | ||
testsRun: int | ||
def __init__(self) -> None: ... | ||
def __init__(self, *args: Any, **kwargs: Any) -> None: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a TODO entry to sync this signature with unittest.TestResult
?
Assigned to @sobolevn. If you don't want to lead the review here, feel free to unassign yourself. |
Removes 25 entries form the todolist.
I moved
RemovedInDjangoXX
allowlist entries at the bottom of theallowlist.txt
so it's easier to find/update them.