mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -4,44 +4,44 @@ import unittest.loader
|
||||
import unittest.result
|
||||
import unittest.suite
|
||||
from types import ModuleType
|
||||
from typing import Any, Iterable, List, Optional, Protocol, Type, Union
|
||||
from typing import Any, Iterable, List, Protocol, Type
|
||||
|
||||
class _TestRunner(Protocol):
|
||||
def run(self, test: Union[unittest.suite.TestSuite, unittest.case.TestCase]) -> unittest.result.TestResult: ...
|
||||
def run(self, test: unittest.suite.TestSuite | unittest.case.TestCase) -> unittest.result.TestResult: ...
|
||||
|
||||
# not really documented
|
||||
class TestProgram:
|
||||
result: unittest.result.TestResult
|
||||
module: Union[None, str, ModuleType]
|
||||
module: None | str | ModuleType
|
||||
verbosity: int
|
||||
failfast: Optional[bool]
|
||||
catchbreak: Optional[bool]
|
||||
buffer: Optional[bool]
|
||||
progName: Optional[str]
|
||||
warnings: Optional[str]
|
||||
failfast: bool | None
|
||||
catchbreak: bool | None
|
||||
buffer: bool | None
|
||||
progName: str | None
|
||||
warnings: str | None
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
testNamePatterns: Optional[List[str]]
|
||||
testNamePatterns: List[str] | None
|
||||
def __init__(
|
||||
self,
|
||||
module: Union[None, str, ModuleType] = ...,
|
||||
defaultTest: Union[str, Iterable[str], None] = ...,
|
||||
argv: Optional[List[str]] = ...,
|
||||
testRunner: Union[Type[_TestRunner], _TestRunner, None] = ...,
|
||||
module: None | str | ModuleType = ...,
|
||||
defaultTest: str | Iterable[str] | None = ...,
|
||||
argv: List[str] | None = ...,
|
||||
testRunner: Type[_TestRunner] | _TestRunner | None = ...,
|
||||
testLoader: unittest.loader.TestLoader = ...,
|
||||
exit: bool = ...,
|
||||
verbosity: int = ...,
|
||||
failfast: Optional[bool] = ...,
|
||||
catchbreak: Optional[bool] = ...,
|
||||
buffer: Optional[bool] = ...,
|
||||
warnings: Optional[str] = ...,
|
||||
failfast: bool | None = ...,
|
||||
catchbreak: bool | None = ...,
|
||||
buffer: bool | None = ...,
|
||||
warnings: str | None = ...,
|
||||
*,
|
||||
tb_locals: bool = ...,
|
||||
) -> None: ...
|
||||
def usageExit(self, msg: Any = ...) -> None: ...
|
||||
def parseArgs(self, argv: List[str]) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def createTests(self, from_discovery: bool = ..., Loader: Optional[unittest.loader.TestLoader] = ...) -> None: ...
|
||||
def createTests(self, from_discovery: bool = ..., Loader: unittest.loader.TestLoader | None = ...) -> None: ...
|
||||
else:
|
||||
def createTests(self) -> None: ...
|
||||
def runTests(self) -> None: ... # undocumented
|
||||
|
||||
Reference in New Issue
Block a user