mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 04:54:48 +08:00
Improve TestCase.assertNumQueries type (#250)
This commit is contained in:
committed by
Maksim Kurnikov
parent
9ca79c24a2
commit
58b26fdbd3
@@ -1,7 +1,7 @@
|
|||||||
import threading
|
import threading
|
||||||
import unittest
|
import unittest
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Type, Union, ClassVar
|
from typing import Any, Callable, Dict, Iterator, List, Optional, Set, Tuple, Type, Union, ClassVar, overload
|
||||||
|
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
from django.core.handlers.wsgi import WSGIHandler
|
from django.core.handlers.wsgi import WSGIHandler
|
||||||
@@ -146,9 +146,14 @@ class TransactionTestCase(SimpleTestCase):
|
|||||||
ordered: bool = ...,
|
ordered: bool = ...,
|
||||||
msg: Optional[str] = ...,
|
msg: Optional[str] = ...,
|
||||||
) -> None: ...
|
) -> None: ...
|
||||||
|
@overload
|
||||||
def assertNumQueries(
|
def assertNumQueries(
|
||||||
self, num: int, func: Optional[Union[Callable, Type[list]]] = ..., *args: Any, using: Any = ..., **kwargs: Any
|
self, num: int, func: Callable[..., Any], *args: Any, using: str = ..., **kwargs: Any
|
||||||
) -> Optional[_AssertNumQueriesContext]: ...
|
) -> None: ...
|
||||||
|
@overload
|
||||||
|
def assertNumQueries(
|
||||||
|
self, num: int, func: None = ..., *args: Any, using: str = ..., **kwargs: Any
|
||||||
|
) -> _AssertNumQueriesContext: ...
|
||||||
|
|
||||||
class TestCase(TransactionTestCase):
|
class TestCase(TransactionTestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user