mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-06 12:14:28 +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 unittest
|
||||
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.handlers.wsgi import WSGIHandler
|
||||
@@ -146,9 +146,14 @@ class TransactionTestCase(SimpleTestCase):
|
||||
ordered: bool = ...,
|
||||
msg: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def assertNumQueries(
|
||||
self, num: int, func: Optional[Union[Callable, Type[list]]] = ..., *args: Any, using: Any = ..., **kwargs: Any
|
||||
) -> Optional[_AssertNumQueriesContext]: ...
|
||||
self, num: int, func: Callable[..., Any], *args: Any, using: str = ..., **kwargs: Any
|
||||
) -> None: ...
|
||||
@overload
|
||||
def assertNumQueries(
|
||||
self, num: int, func: None = ..., *args: Any, using: str = ..., **kwargs: Any
|
||||
) -> _AssertNumQueriesContext: ...
|
||||
|
||||
class TestCase(TransactionTestCase):
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user