|
1 | 1 | import datetime |
2 | 2 |
|
| 3 | +from types import TracebackType |
3 | 4 | from typing import \ |
4 | 5 | Any, Container, Type, Callable, Tuple, Union, ContextManager, \ |
5 | | - Pattern, Optional, Iterable, NoReturn |
| 6 | + Pattern, Optional, Iterable, Text, NoReturn |
6 | 7 |
|
7 | 8 | class AssertRaisesContext: |
8 | | - exception = ... # type: Type[BaseException] |
9 | | - msg_fmt = ... # type: str |
10 | | - def __init__(self, exception: Type[BaseException], msg_fmt: str = ...) -> None: ... |
| 9 | + exception: Type[BaseException] |
| 10 | + msg_fmt: Text |
| 11 | + def __init__(self, exception: Type[BaseException], msg_fmt: Text = ...) -> None: ... |
11 | 12 | def __enter__(self) -> AssertRaisesContext: ... |
12 | | - def __exit__(self, exc_type: Type[BaseException], exc_val: BaseException, exc_tb: Any) -> None: ... |
13 | | - def format_message(self, default_msg: str) -> str: ... |
| 13 | + def __exit__(self, exc_type: Optional[Type[BaseException]], |
| 14 | + exc_val: Optional[BaseException], |
| 15 | + exc_tb: Optional[TracebackType]) -> Optional[bool]: ... |
| 16 | + def format_message(self, default_msg: Text) -> Text: ... |
14 | 17 | def add_test(self, cb: Callable[[BaseException], None]) -> None: ... |
15 | 18 |
|
16 | 19 | class AssertRaisesErrnoContext(AssertRaisesContext): |
17 | | - expected_errno = ... # type: int |
18 | | - def __init__(self, exception: Type[BaseException], expected_errno: int, msg_fmt: str = ...) -> None: ... |
| 20 | + expected_errno: int |
| 21 | + def __init__(self, exception: Type[BaseException], expected_errno: int, msg_fmt: Text = ...) -> None: ... |
19 | 22 |
|
20 | 23 | class AssertRaisesRegexContext(AssertRaisesContext): |
21 | | - pattern = ... # type: str |
22 | | - def __init__(self, exception: Type[BaseException], pattern: str, msg_fmt: str = ...) -> None: ... |
| 24 | + pattern: Text |
| 25 | + def __init__(self, exception: Type[BaseException], pattern: Text, msg_fmt: Text = ...) -> None: ... |
23 | 26 |
|
24 | 27 | class AssertWarnsContext: |
25 | | - def __init__(self, warning_class: Type[Warning], msg_fmt: str = ...) -> None: ... |
| 28 | + def __init__(self, warning_class: Type[Warning], msg_fmt: Text = ...) -> None: ... |
26 | 29 | def __enter__(self) -> None: ... |
27 | 30 | def __exit__(self, exc_type: Type[BaseException], exc_val: BaseException, exc_tb: Any) -> None: ... |
28 | | - def format_message(self) -> str: ... |
| 31 | + def format_message(self) -> Text: ... |
29 | 32 | def add_test(self, cb: Callable[[Warning], None]) -> None: ... |
30 | 33 |
|
31 | 34 | class AssertWarnsRegexContext(AssertWarnsContext): |
32 | | - pattern = ... # type: str |
33 | | - def __init__(self, warning_class: Type[Warning], msg_fmt: str = ...) -> None: ... |
| 35 | + pattern: Text |
| 36 | + def __init__(self, warning_class: Type[Warning], msg_fmt: Text = ...) -> None: ... |
34 | 37 |
|
35 | | -def fail(msg: str = ...) -> NoReturn: ... |
36 | | -def assert_true(expr: Any, msg_fmt: str = ...) -> None: ... |
37 | | -def assert_false(expr: Any, msg_fmt: str = ...) -> None: ... |
38 | | -def assert_boolean_true(expr: Any, msg_fmt: str = ...) -> None: ... |
39 | | -def assert_boolean_false(expr: Any, msg_fmt: str = ...) -> None: ... |
40 | | -def assert_is_none(expr: Any, msg_fmt: str = ...) -> None: ... |
41 | | -def assert_is_not_none(expr: Any, msg_fmt: str = ...) -> None: ... |
42 | | -def assert_equal(first: Any, second: Any, msg_fmt: str = ...) -> None: ... |
43 | | -def assert_not_equal(first: Any, second: Any, msg_fmt: str = ...) -> None: ... |
44 | | -def assert_almost_equal(first: float, second: float, msg_fmt: str = ..., places: int = ..., delta: float = ...) -> None: ... |
45 | | -def assert_not_almost_equal(first: float, second: float, msg_fmt: str = ..., places: int = ..., delta: float = ...) -> None: ... |
46 | | -def assert_less(first: Any, second: Any, msg_fmt: str = ...) -> None: ... |
47 | | -def assert_less_equal(first: Any, second: Any, msg_fmt: str = ...) -> None: ... |
48 | | -def assert_greater(first: Any, second: Any, msg_fmt: str = ...) -> None: ... |
49 | | -def assert_greater_equal(first: Any, second: Any, msg_fmt: str = ...) -> None: ... |
50 | | -def assert_regex(text: str, regex: Union[str, Pattern[str]], msg_fmt: str = ...) -> None: ... |
51 | | -def assert_is(first: Any, second: Any, msg_fmt: str = ...) -> None: ... |
52 | | -def assert_is_not(first: Any, second: Any, msg_fmt: str = ...) -> None: ... |
53 | | -def assert_in(first: Any, second: Container[Any], msg_fmt: str = ...) -> None: ... |
54 | | -def assert_not_in(first: Any, second: Container[Any], msg_fmt: str = ...) -> None: ... |
55 | | -def assert_between(lower_bound: Any, upper_bound: Any, expr: Any, msg_fmt: str = ...) -> None: ... |
56 | | -def assert_is_instance(obj: Any, cls: Union[type, Tuple[type, ...]], msg_fmt: str = ...) -> None: ... |
57 | | -def assert_not_is_instance(obj: Any, cls: Union[type, Tuple[type, ...]], msg_fmt: str = ...) -> None: ... |
58 | | -def assert_count_equal(sequence1: Iterable[Any], sequence2: Iterable[Any], msg_fmt: str = ...) -> None: ... |
59 | | -def assert_has_attr(obj: Any, attribute: str, msg_fmt: str = ...) -> None: ... |
60 | | -def assert_datetime_about_now(actual: Optional[datetime.datetime], msg_fmt: str = ...) -> None: ... |
61 | | -def assert_datetime_about_now_utc(actual: Optional[datetime.datetime], msg_fmt: str = ...) -> None: ... |
62 | | -def assert_raises(exception: Type[BaseException], msg_fmt: str = ...) -> AssertRaisesContext: ... |
63 | | -def assert_raises_regex(exception: Type[BaseException], regex: Union[str, Pattern[str]], msg_fmt: str = ...) -> AssertRaisesContext: ... |
64 | | -def assert_raises_errno(exception: Type[BaseException], errno: int, msg_fmt: str = ...) -> AssertRaisesContext: ... |
65 | | -def assert_succeeds(exception: Type[BaseException], msg_fmt: str = ...) -> ContextManager: ... |
66 | | -def assert_warns(warning_type: Type[Warning], msg_fmt: str = ...) -> AssertWarnsContext: ... |
67 | | -def assert_warns_regex(warning_type: Type[Warning], regex: str, msg_fmt: str = ...) -> AssertWarnsContext: ... |
| 38 | +def fail(msg: Text = ...) -> NoReturn: ... |
| 39 | +def assert_true(expr: Any, msg_fmt: Text = ...) -> None: ... |
| 40 | +def assert_false(expr: Any, msg_fmt: Text = ...) -> None: ... |
| 41 | +def assert_boolean_true(expr: Any, msg_fmt: Text = ...) -> None: ... |
| 42 | +def assert_boolean_false(expr: Any, msg_fmt: Text = ...) -> None: ... |
| 43 | +def assert_is_none(expr: Any, msg_fmt: Text = ...) -> None: ... |
| 44 | +def assert_is_not_none(expr: Any, msg_fmt: Text = ...) -> None: ... |
| 45 | +def assert_equal(first: Any, second: Any, msg_fmt: Text = ...) -> None: ... |
| 46 | +def assert_not_equal(first: Any, second: Any, msg_fmt: Text = ...) -> None: ... |
| 47 | +def assert_almost_equal(first: float, second: float, msg_fmt: Text = ..., places: int = ..., delta: float = ...) -> None: ... |
| 48 | +def assert_not_almost_equal(first: float, second: float, msg_fmt: Text = ..., places: int = ..., delta: float = ...) -> None: ... |
| 49 | +def assert_less(first: Any, second: Any, msg_fmt: Text = ...) -> None: ... |
| 50 | +def assert_less_equal(first: Any, second: Any, msg_fmt: Text = ...) -> None: ... |
| 51 | +def assert_greater(first: Any, second: Any, msg_fmt: Text = ...) -> None: ... |
| 52 | +def assert_greater_equal(first: Any, second: Any, msg_fmt: Text = ...) -> None: ... |
| 53 | +def assert_regex(text: Text, regex: Union[Text, Pattern[Text]], msg_fmt: Text = ...) -> None: ... |
| 54 | +def assert_is(first: Any, second: Any, msg_fmt: Text = ...) -> None: ... |
| 55 | +def assert_is_not(first: Any, second: Any, msg_fmt: Text = ...) -> None: ... |
| 56 | +def assert_in(first: Any, second: Container[Any], msg_fmt: Text = ...) -> None: ... |
| 57 | +def assert_not_in(first: Any, second: Container[Any], msg_fmt: Text = ...) -> None: ... |
| 58 | +def assert_between(lower_bound: Any, upper_bound: Any, expr: Any, msg_fmt: Text = ...) -> None: ... |
| 59 | +def assert_is_instance(obj: Any, cls: Union[type, Tuple[type, ...]], msg_fmt: Text = ...) -> None: ... |
| 60 | +def assert_not_is_instance(obj: Any, cls: Union[type, Tuple[type, ...]], msg_fmt: Text = ...) -> None: ... |
| 61 | +def assert_count_equal(sequence1: Iterable[Any], sequence2: Iterable[Any], msg_fmt: Text = ...) -> None: ... |
| 62 | +def assert_has_attr(obj: Any, attribute: str, msg_fmt: Text = ...) -> None: ... |
| 63 | +def assert_datetime_about_now(actual: Optional[datetime.datetime], msg_fmt: Text = ...) -> None: ... |
| 64 | +def assert_datetime_about_now_utc(actual: Optional[datetime.datetime], msg_fmt: Text = ...) -> None: ... |
| 65 | +def assert_raises(exception: Type[BaseException], msg_fmt: Text = ...) -> AssertRaisesContext: ... |
| 66 | +def assert_raises_regex(exception: Type[BaseException], regex: Union[Text, Pattern[Text]], msg_fmt: Text = ...) -> AssertRaisesContext: ... |
| 67 | +def assert_raises_errno(exception: Type[BaseException], errno: int, msg_fmt: Text = ...) -> AssertRaisesContext: ... |
| 68 | +def assert_succeeds(exception: Type[BaseException], msg_fmt: Text = ...) -> ContextManager: ... |
| 69 | +def assert_warns(warning_type: Type[Warning], msg_fmt: Text = ...) -> AssertWarnsContext: ... |
| 70 | +def assert_warns_regex(warning_type: Type[Warning], regex: Text, msg_fmt: Text = ...) -> AssertWarnsContext: ... |
0 commit comments