Skip to content

Commit b84327f

Browse files
committed
Mark fail() as NoReturn
1 parent 1f85b5c commit b84327f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

NEWS.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
News in asserts 0.8.2
22
=====================
33

4+
Improvements
5+
------------
6+
7+
* `fail()` is now marked with `NoReturn` in type stub.
8+
49
News in asserts 0.8.1
510
=====================
611

asserts/__init__.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import datetime
22

33
from typing import \
4-
Any, Container, List, Type, Callable, Tuple, Union, ContextManager, \
5-
Pattern, Optional, Iterable
4+
Any, Container, Type, Callable, Tuple, Union, ContextManager, \
5+
Pattern, Optional, Iterable, NoReturn
66

77
class AssertRaisesContext:
88
exception = ... # type: Type[BaseException]
@@ -32,7 +32,7 @@ class AssertWarnsRegexContext(AssertWarnsContext):
3232
pattern = ... # type: str
3333
def __init__(self, warning_class: Type[Warning], msg_fmt: str = ...) -> None: ...
3434

35-
def fail(msg: str = ...) -> None: ...
35+
def fail(msg: str = ...) -> NoReturn: ...
3636
def assert_true(expr: Any, msg_fmt: str = ...) -> None: ...
3737
def assert_false(expr: Any, msg_fmt: str = ...) -> None: ...
3838
def assert_boolean_true(expr: Any, msg_fmt: str = ...) -> None: ...

0 commit comments

Comments
 (0)