-
-
Notifications
You must be signed in to change notification settings - Fork 521
Update django.test.runner stubs
#1888
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
Conversation
sobolevn
left a comment
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
| 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
| 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?
| 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
RemovedInDjangoXXallowlist entries at the bottom of theallowlist.txtso it's easier to find/update them.