mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Use variable annotations everywhere (#2909)
This commit is contained in:
committed by
Sebastian Rittau
parent
b3c76aab49
commit
efb67946f8
@@ -25,15 +25,15 @@ class Testable(metaclass=ABCMeta):
|
||||
# TODO ABC for test runners?
|
||||
|
||||
class TestResult:
|
||||
errors = ... # type: List[Tuple[Testable, str]]
|
||||
failures = ... # type: List[Tuple[Testable, str]]
|
||||
skipped = ... # type: List[Tuple[Testable, str]]
|
||||
expectedFailures = ... # type: List[Tuple[Testable, str]]
|
||||
unexpectedSuccesses = ... # type: List[Testable]
|
||||
shouldStop = ... # type: bool
|
||||
testsRun = ... # type: int
|
||||
buffer = ... # type: bool
|
||||
failfast = ... # type: bool
|
||||
errors: List[Tuple[Testable, str]]
|
||||
failures: List[Tuple[Testable, str]]
|
||||
skipped: List[Tuple[Testable, str]]
|
||||
expectedFailures: List[Tuple[Testable, str]]
|
||||
unexpectedSuccesses: List[Testable]
|
||||
shouldStop: bool
|
||||
testsRun: int
|
||||
buffer: bool
|
||||
failfast: bool
|
||||
|
||||
def wasSuccessful(self) -> bool: ...
|
||||
def stop(self) -> None: ...
|
||||
@@ -49,22 +49,22 @@ class TestResult:
|
||||
def addUnexpectedSuccess(self, test: Testable) -> None: ...
|
||||
|
||||
class _AssertRaisesBaseContext:
|
||||
expected = ... # type: Any
|
||||
failureException = ... # type: Type[BaseException]
|
||||
obj_name = ... # type: str
|
||||
expected_regex = ... # type: Pattern[str]
|
||||
expected: Any
|
||||
failureException: Type[BaseException]
|
||||
obj_name: str
|
||||
expected_regex: Pattern[str]
|
||||
|
||||
class _AssertRaisesContext(_AssertRaisesBaseContext):
|
||||
exception = ... # type: Any # TODO precise type
|
||||
exception: Any
|
||||
def __enter__(self) -> _AssertRaisesContext: ...
|
||||
def __exit__(self, exc_type, exc_value, tb) -> bool: ...
|
||||
|
||||
class TestCase(Testable):
|
||||
failureException = ... # type: Type[BaseException]
|
||||
longMessage = ... # type: bool
|
||||
maxDiff = ... # type: Optional[int]
|
||||
failureException: Type[BaseException]
|
||||
longMessage: bool
|
||||
maxDiff: Optional[int]
|
||||
# undocumented
|
||||
_testMethodName = ... # type: str
|
||||
_testMethodName: str
|
||||
def __init__(self, methodName: str = ...) -> None: ...
|
||||
def setUp(self) -> None: ...
|
||||
def tearDown(self) -> None: ...
|
||||
@@ -189,9 +189,9 @@ class TestSuite(Testable):
|
||||
def __iter__(self) -> Iterator[Testable]: ...
|
||||
|
||||
class TestLoader:
|
||||
testMethodPrefix = ... # type: str
|
||||
sortTestMethodsUsing = ... # type: Optional[Callable[[str, str], int]]
|
||||
suiteClass = ... # type: Callable[[List[TestCase]], TestSuite]
|
||||
testMethodPrefix: str
|
||||
sortTestMethodsUsing: Optional[Callable[[str, str], int]]
|
||||
suiteClass: Callable[[List[TestCase]], TestSuite]
|
||||
def loadTestsFromTestCase(self,
|
||||
testCaseClass: Type[TestCase]) -> TestSuite: ...
|
||||
def loadTestsFromModule(self, module: types.ModuleType = ...,
|
||||
@@ -204,7 +204,7 @@ class TestLoader:
|
||||
top_level_dir: Optional[str] = ...) -> TestSuite: ...
|
||||
def getTestCaseNames(self, testCaseClass: Type[TestCase] = ...) -> List[str]: ...
|
||||
|
||||
defaultTestLoader = ... # type: TestLoader
|
||||
defaultTestLoader: TestLoader
|
||||
|
||||
class TextTestResult(TestResult):
|
||||
def __init__(self, stream: TextIO, descriptions: bool, verbosity: int) -> None: ...
|
||||
@@ -226,7 +226,7 @@ def skip(reason: Union[str, unicode]) -> Any: ...
|
||||
|
||||
# not really documented
|
||||
class TestProgram:
|
||||
result = ... # type: TestResult
|
||||
result: TestResult
|
||||
def runTests(self) -> None: ... # undocumented
|
||||
|
||||
def main(module: Union[None, Text, types.ModuleType] = ..., defaultTest: Optional[str] = ...,
|
||||
@@ -247,4 +247,4 @@ def removeHandler() -> None: ...
|
||||
def removeHandler(function: Callable[..., Any]) -> Callable[..., Any]: ...
|
||||
|
||||
# private but occasionally used
|
||||
util = ... # type: types.ModuleType
|
||||
util: types.ModuleType
|
||||
|
||||
Reference in New Issue
Block a user