diff --git a/stdlib/2/unittest.pyi b/stdlib/2/unittest.pyi index bcd13e15d001..e8b1b7f62273 100644 --- a/stdlib/2/unittest.pyi +++ b/stdlib/2/unittest.pyi @@ -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: ... diff --git a/stdlib/3/unittest/__init__.pyi b/stdlib/3/unittest/__init__.pyi index 6c0e409d9c7c..7bbbb0d40676 100644 --- a/stdlib/3/unittest/__init__.pyi +++ b/stdlib/3/unittest/__init__.pyi @@ -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: ...