Improve type of TestCase.captureOnCommitCallbacks (#1202)

Co-authored-by: Adam Johnson <me@adamj.eu>
This commit is contained in:
Petter Friberg
2022-10-25 10:47:09 +02:00
committed by GitHub
parent adb26248db
commit 6aecafc64f

View File

@@ -1,5 +1,6 @@
import threading
import unittest
from contextlib import contextmanager
from datetime import date
from types import TracebackType
from typing import (
@@ -7,6 +8,7 @@ from typing import (
Callable,
Collection,
Dict,
Generator,
Iterable,
Iterator,
List,
@@ -216,7 +218,11 @@ class TransactionTestCase(SimpleTestCase):
class TestCase(TransactionTestCase):
@classmethod
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:
conditions: Sequence[Tuple[Callable, str]] = ...