Use variable annotations everywhere (#2909)

This commit is contained in:
Michael Lee
2019-04-13 01:40:52 -07:00
committed by Sebastian Rittau
parent b3c76aab49
commit efb67946f8
458 changed files with 9135 additions and 9135 deletions

View File

@@ -25,11 +25,11 @@ class SkipTest(Exception):
class TestCase:
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: ...
@@ -199,22 +199,22 @@ class FunctionTestCase(TestCase):
description: Optional[str] = ...) -> None: ...
class _AssertRaisesContext(Generic[_E]):
exception = ... # type: _E
exception: _E
def __enter__(self) -> _AssertRaisesContext[_E]: ...
def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> bool: ...
class _AssertWarnsContext:
warning = ... # type: Warning
filename = ... # type: str
lineno = ... # type: int
warning: Warning
filename: str
lineno: int
def __enter__(self) -> _AssertWarnsContext: ...
def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> bool: ...
class _AssertLogsContext:
records = ... # type: List[logging.LogRecord]
output = ... # type: List[str]
records: List[logging.LogRecord]
output: List[str]
def __enter__(self) -> _AssertLogsContext: ...
def __exit__(self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException],
exc_tb: Optional[TracebackType]) -> bool: ...
@@ -234,10 +234,10 @@ class TestSuite(Iterable[_TestType]):
class TestLoader:
if sys.version_info >= (3, 5):
errors = ... # type: List[Type[BaseException]]
testMethodPrefix = ... # type: str
sortTestMethodsUsing = ... # type: Callable[[str, str], bool]
suiteClass = ... # type: Callable[[List[TestCase]], TestSuite]
errors: List[Type[BaseException]]
testMethodPrefix: str
sortTestMethodsUsing: Callable[[str, str], bool]
suiteClass: Callable[[List[TestCase]], TestSuite]
def loadTestsFromTestCase(self,
testCaseClass: Type[TestCase]) -> TestSuite: ...
if sys.version_info >= (3, 5):
@@ -260,16 +260,16 @@ _SysExcInfoType = Tuple[Optional[Type[BaseException]],
Optional[TracebackType]]
class TestResult:
errors = ... # type: List[Tuple[TestCase, str]]
failures = ... # type: List[Tuple[TestCase, str]]
skipped = ... # type: List[Tuple[TestCase, str]]
expectedFailures = ... # type: List[Tuple[TestCase, str]]
unexpectedSuccesses = ... # type: List[TestCase]
shouldStop = ... # type: bool
testsRun = ... # type: int
buffer = ... # type: bool
failfast = ... # type: bool
tb_locals = ... # type: bool
errors: List[Tuple[TestCase, str]]
failures: List[Tuple[TestCase, str]]
skipped: List[Tuple[TestCase, str]]
expectedFailures: List[Tuple[TestCase, str]]
unexpectedSuccesses: List[TestCase]
shouldStop: bool
testsRun: int
buffer: bool
failfast: bool
tb_locals: bool
def wasSuccessful(self) -> bool: ...
def stop(self) -> None: ...
def startTest(self, test: TestCase) -> None: ...
@@ -300,7 +300,7 @@ class TextTestResult(TestResult):
def printErrorList(self, flavour: str, errors: Tuple[TestCase, str]) -> None: ...
_TextTestResult = TextTestResult
defaultTestLoader = ... # type: TestLoader
defaultTestLoader: TestLoader
_ResultClassType = Callable[[IO[str], bool, int], TestResult]
@@ -334,7 +334,7 @@ class TextTestRunner(TestRunner):
# not really documented
class TestProgram:
result = ... # type: TestResult
result: TestResult
def runTests(self) -> None: ... # undocumented
def main(module: Union[None, str, ModuleType] = ...,

View File

@@ -3,26 +3,26 @@
import sys
from typing import Any, Optional, Text, Type
FILTER_DIR = ... # type: Any
FILTER_DIR: Any
class _slotted: ...
class _SentinelObject:
name = ... # type: Any
name: Any
def __init__(self, name: Any) -> None: ...
class _Sentinel:
def __init__(self) -> None: ...
def __getattr__(self, name: str) -> Any: ...
sentinel = ... # type: Any
DEFAULT = ... # type: Any
sentinel: Any
DEFAULT: Any
class _CallList(list):
def __contains__(self, value: Any) -> bool: ...
class _MockIter:
obj = ... # type: Any
obj: Any
def __init__(self, obj: Any) -> None: ...
def __iter__(self) -> Any: ...
def __next__(self) -> Any: ...
@@ -36,50 +36,50 @@ class Base:
NonCallableMock: Any
class CallableMixin(Base):
side_effect = ... # type: Any
side_effect: Any
def __init__(self, spec: Optional[Any] = ..., side_effect: Optional[Any] = ..., return_value: Any = ..., wraps: Optional[Any] = ..., name: Optional[Any] = ..., spec_set: Optional[Any] = ..., parent: Optional[Any] = ..., _spec_state: Optional[Any] = ..., _new_name: Any = ..., _new_parent: Optional[Any] = ..., **kwargs: Any) -> None: ...
def __call__(_mock_self, *args: Any, **kwargs: Any) -> Any: ...
Mock: Any
class _patch:
attribute_name = ... # type: Any
getter = ... # type: Any
attribute = ... # type: Any
new = ... # type: Any
new_callable = ... # type: Any
spec = ... # type: Any
create = ... # type: bool
has_local = ... # type: Any
spec_set = ... # type: Any
autospec = ... # type: Any
kwargs = ... # type: Any
additional_patchers = ... # type: Any
attribute_name: Any
getter: Any
attribute: Any
new: Any
new_callable: Any
spec: Any
create: bool
has_local: Any
spec_set: Any
autospec: Any
kwargs: Any
additional_patchers: Any
def __init__(self, getter: Any, attribute: Any, new: Any, spec: Any, create: Any, spec_set: Any, autospec: Any, new_callable: Any, kwargs: Any) -> None: ...
def copy(self) -> Any: ...
def __call__(self, func: Any) -> Any: ...
def decorate_class(self, klass: Any) -> Any: ...
def decorate_callable(self, func: Any) -> Any: ...
def get_original(self) -> Any: ...
target = ... # type: Any
temp_original = ... # type: Any
is_local = ... # type: Any
target: Any
temp_original: Any
is_local: Any
def __enter__(self) -> Any: ...
def __exit__(self, *exc_info: Any) -> Any: ...
def start(self) -> Any: ...
def stop(self) -> Any: ...
class _patch_dict:
in_dict = ... # type: Any
values = ... # type: Any
clear = ... # type: Any
in_dict: Any
values: Any
clear: Any
def __init__(self, in_dict: Any, values: Any = ..., clear: Any = ..., **kwargs: Any) -> None: ...
def __call__(self, f: Any) -> Any: ...
def decorate_class(self, klass: Any) -> Any: ...
def __enter__(self) -> Any: ...
def __exit__(self, *args: Any) -> Any: ...
start = ... # type: Any
stop = ... # type: Any
start: Any
stop: Any
class _patcher:
TEST_PREFIX: str
@@ -98,8 +98,8 @@ NonCallableMagicMock: Any
MagicMock: Any
class MagicProxy:
name = ... # type: Any
parent = ... # type: Any
name: Any
parent: Any
def __init__(self, name: Any, parent: Any) -> None: ...
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
def create_mock(self) -> Any: ...
@@ -109,33 +109,33 @@ class _ANY:
def __eq__(self, other: Any) -> bool: ...
def __ne__(self, other: Any) -> bool: ...
ANY = ... # type: Any
ANY: Any
class _Call(tuple):
def __new__(cls, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> Any: ...
name = ... # type: Any
parent = ... # type: Any
from_kall = ... # type: Any
name: Any
parent: Any
from_kall: Any
def __init__(self, value: Any = ..., name: Optional[Any] = ..., parent: Optional[Any] = ..., two: bool = ..., from_kall: bool = ...) -> None: ...
def __eq__(self, other: Any) -> bool: ...
__ne__ = ... # type: Any
__ne__: Any
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
def __getattr__(self, attr: Any) -> Any: ...
def count(self, *args: Any, **kwargs: Any) -> Any: ...
def index(self, *args: Any, **kwargs: Any) -> Any: ...
def call_list(self) -> Any: ...
call = ... # type: Any
call: Any
def create_autospec(spec: Any, spec_set: Any = ..., instance: Any = ..., _parent: Optional[Any] = ..., _name: Optional[Any] = ..., **kwargs: Any) -> Any: ...
class _SpecState:
spec = ... # type: Any
ids = ... # type: Any
spec_set = ... # type: Any
parent = ... # type: Any
instance = ... # type: Any
name = ... # type: Any
spec: Any
ids: Any
spec_set: Any
parent: Any
instance: Any
name: Any
def __init__(self, spec: Any, spec_set: Any = ..., parent: Optional[Any] = ..., name: Optional[Any] = ..., ids: Optional[Any] = ..., instance: Any = ...) -> None: ...
def mock_open(mock: Optional[Any] = ..., read_data: Any = ...) -> Any: ...