Skip to content
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

Fix argument types of assertNumQueries and assertQuerySetEqual #1823

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions django-stubs/test/testcases.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,12 @@ class TransactionTestCase(SimpleTestCase):
self,
qs: Iterator[Any] | list[Model] | QuerySet | RawQuerySet,
values: Collection[Any],
transform: Callable[[Model], Any] | type[str] = ...,
transform: Callable[[Model], Any] | type[str] | None = ...,
ordered: bool = ...,
msg: str | None = ...,
) -> None: ...
@overload
def assertNumQueries(self, num: int, using: str = ...) -> _AssertNumQueriesContext: ... # type: ignore[misc]
def assertNumQueries(self, num: int, func: None = ..., *, using: str = ...) -> _AssertNumQueriesContext: ...
@overload
def assertNumQueries(
self, num: int, func: Callable[..., Any], *args: Any, using: str = ..., **kwargs: Any
Expand Down
4 changes: 0 additions & 4 deletions scripts/stubtest/allowlist_todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1953,8 +1953,6 @@ django.templatetags.tz.timezone_constructor
django.test.SimpleTestCase.assertFormError
django.test.SimpleTestCase.assertFormSetError
django.test.SimpleTestCase.assertTemplateNotUsed
django.test.TransactionTestCase.assertNumQueries
django.test.TransactionTestCase.assertQuerySetEqual
django.test.runner.DiscoverRunner.build_suite
django.test.runner.DiscoverRunner.log
django.test.runner.DiscoverRunner.reorder_by
Expand Down Expand Up @@ -1997,8 +1995,6 @@ django.test.testcases.SerializeMixin.tearDownClass
django.test.testcases.SimpleTestCase.assertFormError
django.test.testcases.SimpleTestCase.assertFormSetError
django.test.testcases.SimpleTestCase.assertTemplateNotUsed
django.test.testcases.TransactionTestCase.assertNumQueries
django.test.testcases.TransactionTestCase.assertQuerySetEqual
django.test.testcases._AssertTemplateUsedContext.__init__
django.test.testcases._AssertTemplateUsedContext.message
django.test.utils.TimeKeeperProtocol
Expand Down