File: main.pyi

package info (click to toggle)
typeshed 0.0~git20241223.ea91db2-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 28,756 kB
  • sloc: python: 7,741; makefile: 20; sh: 18
file content (73 lines) | stat: -rw-r--r-- 2,616 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import sys
import unittest.case
import unittest.loader
import unittest.result
import unittest.suite
from collections.abc import Iterable
from types import ModuleType
from typing import Any, Final, Protocol
from typing_extensions import deprecated

MAIN_EXAMPLES: Final[str]
MODULE_EXAMPLES: Final[str]

class _TestRunner(Protocol):
    def run(self, test: unittest.suite.TestSuite | unittest.case.TestCase, /) -> unittest.result.TestResult: ...

# not really documented
class TestProgram:
    result: unittest.result.TestResult
    module: None | str | ModuleType
    verbosity: int
    failfast: bool | None
    catchbreak: bool | None
    buffer: bool | None
    progName: str | None
    warnings: str | None
    testNamePatterns: list[str] | None
    if sys.version_info >= (3, 12):
        durations: unittest.result._DurationsType | None
        def __init__(
            self,
            module: None | str | ModuleType = "__main__",
            defaultTest: str | Iterable[str] | None = None,
            argv: list[str] | None = None,
            testRunner: type[_TestRunner] | _TestRunner | None = None,
            testLoader: unittest.loader.TestLoader = ...,
            exit: bool = True,
            verbosity: int = 1,
            failfast: bool | None = None,
            catchbreak: bool | None = None,
            buffer: bool | None = None,
            warnings: str | None = None,
            *,
            tb_locals: bool = False,
            durations: unittest.result._DurationsType | None = None,
        ) -> None: ...
    else:
        def __init__(
            self,
            module: None | str | ModuleType = "__main__",
            defaultTest: str | Iterable[str] | None = None,
            argv: list[str] | None = None,
            testRunner: type[_TestRunner] | _TestRunner | None = None,
            testLoader: unittest.loader.TestLoader = ...,
            exit: bool = True,
            verbosity: int = 1,
            failfast: bool | None = None,
            catchbreak: bool | None = None,
            buffer: bool | None = None,
            warnings: str | None = None,
            *,
            tb_locals: bool = False,
        ) -> None: ...

    if sys.version_info < (3, 13):
        @deprecated("Deprecated in Python 3.11; removal scheduled for Python 3.13")
        def usageExit(self, msg: Any = None) -> None: ...

    def parseArgs(self, argv: list[str]) -> None: ...
    def createTests(self, from_discovery: bool = False, Loader: unittest.loader.TestLoader | None = None) -> None: ...
    def runTests(self) -> None: ...  # undocumented

main = TestProgram