mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-08 13:04:47 +08:00
142 lines
5.5 KiB
Python
142 lines
5.5 KiB
Python
import unittest
|
|
from argparse import ArgumentParser
|
|
from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
|
|
from unittest.case import TestCase, _SubTest
|
|
from unittest.runner import TextTestResult, _WritelnDecorator
|
|
from unittest.suite import TestSuite
|
|
|
|
from django.db.backends.base.base import BaseDatabaseWrapper
|
|
from django.test.testcases import SimpleTestCase, TestCase
|
|
from django.utils.datastructures import OrderedSet
|
|
|
|
class DebugSQLTextTestResult(unittest.TextTestResult):
|
|
buffer: bool
|
|
descriptions: bool
|
|
dots: bool
|
|
errors: List[Tuple[unittest.case.TestCase, str, str]]
|
|
expectedFailures: List[Any]
|
|
failfast: bool
|
|
failures: List[Tuple[unittest.case.TestCase, str, str]]
|
|
shouldStop: bool
|
|
showAll: bool
|
|
skipped: List[Any]
|
|
stream: unittest.runner._WritelnDecorator
|
|
tb_locals: bool
|
|
testsRun: int
|
|
unexpectedSuccesses: List[Any]
|
|
logger: logging.Logger = ...
|
|
def __init__(self, stream: _WritelnDecorator, descriptions: bool, verbosity: int) -> None: ...
|
|
debug_sql_stream: _io.StringIO = ...
|
|
handler: logging.StreamHandler = ...
|
|
def startTest(self, test: TestCase) -> None: ...
|
|
def stopTest(self, test: TestCase) -> None: ...
|
|
def addError(self, test: Any, err: Any) -> None: ...
|
|
def addFailure(self, test: Any, err: Any) -> None: ...
|
|
def addSubTest(self, test: TestCase, subtest: _SubTest, err: None) -> None: ...
|
|
def printErrorList(self, flavour: str, errors: List[Tuple[TestCase, str, str]]) -> None: ...
|
|
|
|
class RemoteTestResult:
|
|
events: List[Any] = ...
|
|
failfast: bool = ...
|
|
shouldStop: bool = ...
|
|
testsRun: int = ...
|
|
def __init__(self) -> None: ...
|
|
@property
|
|
def test_index(self): ...
|
|
def check_picklable(self, test: Any, err: Any) -> None: ...
|
|
def check_subtest_picklable(self, test: Any, subtest: Any) -> None: ...
|
|
def stop_if_failfast(self) -> None: ...
|
|
def stop(self) -> None: ...
|
|
def startTestRun(self) -> None: ...
|
|
def stopTestRun(self) -> None: ...
|
|
def startTest(self, test: Any) -> None: ...
|
|
def stopTest(self, test: Any) -> None: ...
|
|
def addError(self, test: Any, err: Any) -> None: ...
|
|
def addFailure(self, test: Any, err: Any) -> None: ...
|
|
def addSubTest(self, test: Any, subtest: Any, err: Any) -> None: ...
|
|
def addSuccess(self, test: Any) -> None: ...
|
|
def addSkip(self, test: Any, reason: Any) -> None: ...
|
|
def addExpectedFailure(self, test: Any, err: Any) -> None: ...
|
|
def addUnexpectedSuccess(self, test: Any) -> None: ...
|
|
|
|
class RemoteTestRunner:
|
|
resultclass: Any = ...
|
|
failfast: Any = ...
|
|
def __init__(self, failfast: bool = ..., resultclass: Optional[Any] = ...) -> None: ...
|
|
def run(self, test: Any): ...
|
|
|
|
def default_test_processes() -> int: ...
|
|
|
|
class ParallelTestSuite(unittest.TestSuite):
|
|
init_worker: Any = ...
|
|
run_subsuite: Any = ...
|
|
runner_class: Any = ...
|
|
subsuites: Any = ...
|
|
processes: Any = ...
|
|
failfast: Any = ...
|
|
def __init__(self, suite: Any, processes: Any, failfast: bool = ...) -> None: ...
|
|
def run(self, result: Any): ...
|
|
|
|
class DiscoverRunner:
|
|
test_suite: Any = ...
|
|
parallel_test_suite: Any = ...
|
|
test_runner: Any = ...
|
|
test_loader: Any = ...
|
|
reorder_by: Any = ...
|
|
pattern: Optional[str] = ...
|
|
top_level: None = ...
|
|
verbosity: int = ...
|
|
interactive: bool = ...
|
|
failfast: bool = ...
|
|
keepdb: bool = ...
|
|
reverse: bool = ...
|
|
debug_mode: bool = ...
|
|
debug_sql: bool = ...
|
|
parallel: int = ...
|
|
tags: Set[str] = ...
|
|
exclude_tags: Set[str] = ...
|
|
def __init__(
|
|
self,
|
|
pattern: Optional[str] = ...,
|
|
top_level: None = ...,
|
|
verbosity: int = ...,
|
|
interactive: bool = ...,
|
|
failfast: bool = ...,
|
|
keepdb: bool = ...,
|
|
reverse: bool = ...,
|
|
debug_mode: bool = ...,
|
|
debug_sql: bool = ...,
|
|
parallel: int = ...,
|
|
tags: Optional[List[str]] = ...,
|
|
exclude_tags: Optional[List[str]] = ...,
|
|
**kwargs: Any
|
|
) -> None: ...
|
|
@classmethod
|
|
def add_arguments(cls, parser: ArgumentParser) -> None: ...
|
|
def setup_test_environment(self, **kwargs: Any) -> None: ...
|
|
def build_suite(
|
|
self,
|
|
test_labels: Union[List[str], Tuple[str, str]] = ...,
|
|
extra_tests: Optional[List[Any]] = ...,
|
|
**kwargs: Any
|
|
) -> TestSuite: ...
|
|
def setup_databases(self, **kwargs: Any) -> List[Tuple[BaseDatabaseWrapper, str, bool]]: ...
|
|
def get_resultclass(self) -> Optional[Type[DebugSQLTextTestResult]]: ...
|
|
def get_test_runner_kwargs(self) -> Dict[str, Optional[int]]: ...
|
|
def run_checks(self) -> None: ...
|
|
def run_suite(self, suite: TestSuite, **kwargs: Any) -> TextTestResult: ...
|
|
def teardown_databases(self, old_config: List[Tuple[BaseDatabaseWrapper, str, bool]], **kwargs: Any) -> None: ...
|
|
def teardown_test_environment(self, **kwargs: Any) -> None: ...
|
|
def suite_result(self, suite: TestSuite, result: TextTestResult, **kwargs: Any) -> int: ...
|
|
def run_tests(self, test_labels: List[str], extra_tests: List[Any] = ..., **kwargs: Any) -> int: ...
|
|
|
|
def is_discoverable(label: str) -> bool: ...
|
|
def reorder_suite(
|
|
suite: TestSuite, classes: Tuple[Type[TestCase], Type[SimpleTestCase]], reverse: bool = ...
|
|
) -> TestSuite: ...
|
|
def partition_suite_by_type(
|
|
suite: TestSuite, classes: Tuple[Type[TestCase], Type[SimpleTestCase]], bins: List[OrderedSet], reverse: bool = ...
|
|
) -> None: ...
|
|
def partition_suite_by_case(suite: Any): ...
|
|
def filter_tests_by_tags(suite: TestSuite, tags: Set[str], exclude_tags: Set[str]) -> TestSuite: ...
|