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

@@ -1,9 +1,10 @@
# Stubs for unittest
from mypy_extensions import NoReturn
from typing import (
Any, Callable, Dict, Iterable, Iterator, List, Optional, Pattern, Sequence,
Set, FrozenSet, TextIO, Tuple, Type, TypeVar, Union, Generic,
overload, ContextManager
Any, Callable, ContextManager, Dict, FrozenSet, Generic, Iterable, Iterator,
List, Optional, overload, Pattern, Sequence, Set, TextIO, Tuple, Type,
TypeVar, Union
)
import logging
import sys
@@ -134,7 +135,7 @@ class TestCase:
second: Union[Set[Any], FrozenSet[Any]], msg: Any = ...) -> None: ...
def assertDictEqual(self, first: Dict[Any, Any], second: Dict[Any, Any],
msg: Any = ...) -> None: ...
def fail(self, msg: Any = ...) -> None: ...
def fail(self, msg: Any = ...) -> NoReturn: ...
def countTestCases(self) -> int: ...
def defaultTestResult(self) -> TestResult: ...
def id(self) -> str: ...