Skip to content

Commit 882c967

Browse files
Abseil Teamcopybara-github
Abseil Team
authored andcommitted
Annotate absltest.TestCase.fail to help pytype's analysis.
PiperOrigin-RevId: 537162261
1 parent 492b944 commit 882c967

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

absl/testing/absltest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
try:
5757
# pylint: disable=unused-import
5858
import typing
59-
from typing import Any, AnyStr, BinaryIO, Callable, ContextManager, IO, Iterator, List, Mapping, MutableMapping, MutableSequence, Optional, Sequence, Text, TextIO, Tuple, Type, Union
59+
from typing import Any, AnyStr, BinaryIO, Callable, ContextManager, IO, Iterator, List, Mapping, MutableMapping, MutableSequence, NoReturn, Optional, Sequence, Text, TextIO, Tuple, Type, Union
6060
# pylint: enable=unused-import
6161
except ImportError:
6262
pass
@@ -1826,7 +1826,7 @@ def _getAssertEqualityFunc(self, first, second):
18261826

18271827
return super(TestCase, self)._getAssertEqualityFunc(first, second)
18281828

1829-
def fail(self, msg=None, prefix=None):
1829+
def fail(self, msg=None, prefix=None) -> NoReturn:
18301830
"""Fail immediately with the given message, optionally prefixed."""
18311831
return super(TestCase, self).fail(self._formatMessage(prefix, msg))
18321832

0 commit comments

Comments
 (0)