unittest.TestCase.assertRaises(): BaseException (#2594)

In Python 3, just as in Python 2, the expected exception argument to
assertRaises() and assertRaisesRegex() must be a subtype of
BaseException, not just of Exception.

Closes #2593
This commit is contained in:
Peter Pentchev
2018-11-09 04:42:51 +02:00
committed by Jelle Zijlstra
parent e58a338d51
commit f8e5222c46

View File

@@ -12,7 +12,7 @@ from types import ModuleType, TracebackType
_T = TypeVar('_T')
_FT = TypeVar('_FT', bound=Callable[..., Any])
_E = TypeVar('_E', bound=Exception)
_E = TypeVar('_E', bound=BaseException)
def expectedFailure(func: _FT) -> _FT: ...