mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 08:17:08 +08:00
Improve type of TestCase.captureOnCommitCallbacks (#1202)
Co-authored-by: Adam Johnson <me@adamj.eu>
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import threading
|
import threading
|
||||||
import unittest
|
import unittest
|
||||||
|
from contextlib import contextmanager
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from types import TracebackType
|
from types import TracebackType
|
||||||
from typing import (
|
from typing import (
|
||||||
@@ -7,6 +8,7 @@ from typing import (
|
|||||||
Callable,
|
Callable,
|
||||||
Collection,
|
Collection,
|
||||||
Dict,
|
Dict,
|
||||||
|
Generator,
|
||||||
Iterable,
|
Iterable,
|
||||||
Iterator,
|
Iterator,
|
||||||
List,
|
List,
|
||||||
@@ -216,7 +218,11 @@ class TransactionTestCase(SimpleTestCase):
|
|||||||
class TestCase(TransactionTestCase):
|
class TestCase(TransactionTestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpTestData(cls) -> None: ...
|
def setUpTestData(cls) -> None: ...
|
||||||
def captureOnCommitCallbacks(cls, *, using: Optional[str] = ..., execute: bool = ...): ...
|
@classmethod
|
||||||
|
@contextmanager
|
||||||
|
def captureOnCommitCallbacks(
|
||||||
|
cls, *, using: str = ..., execute: bool = ...
|
||||||
|
) -> Generator[List[Callable[[], Any]], None, None]: ...
|
||||||
|
|
||||||
class CheckCondition:
|
class CheckCondition:
|
||||||
conditions: Sequence[Tuple[Callable, str]] = ...
|
conditions: Sequence[Tuple[Callable, str]] = ...
|
||||||
|
|||||||
Reference in New Issue
Block a user