Change the return type of unittest.TestCase.fail() to NoReturn (#1843)

* Change the return type of unittest.TestCase.fail() to NoReturn

* Import mypy_extensions.NoReturn instead of typing.NoReturn
This commit is contained in:
rchen152
2018-01-26 14:28:37 -08:00
committed by Jelle Zijlstra
parent 468d2fa629
commit 66e5863ead
2 changed files with 7 additions and 5 deletions

View File

@@ -4,6 +4,7 @@
# Only a subset of functionality is included.
from mypy_extensions import NoReturn
from typing import (Any, Callable, Dict, FrozenSet, Iterable, List, Optional,
overload, Pattern, Sequence, Set, TextIO, Tuple, Type,
TypeVar, Union)
@@ -131,7 +132,7 @@ class TestCase(Testable):
msg: object = ...) -> None: ...
def assertNotIsInstance(self, obj: Any, cls: Union[type, Tuple[type, ...]],
msg: object = ...) -> None: ...
def fail(self, msg: object = ...) -> None: ...
def fail(self, msg: object = ...) -> NoReturn: ...
def countTestCases(self) -> int: ...
def defaultTestResult(self) -> TestResult: ...
def id(self) -> str: ...