From f8e5222c46292894e89da058f19f43ead729f9fc Mon Sep 17 00:00:00 2001 From: Peter Pentchev Date: Fri, 9 Nov 2018 04:42:51 +0200 Subject: [PATCH] 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 --- stdlib/3/unittest/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/3/unittest/__init__.pyi b/stdlib/3/unittest/__init__.pyi index 5f0bd4833..8f092994b 100644 --- a/stdlib/3/unittest/__init__.pyi +++ b/stdlib/3/unittest/__init__.pyi @@ -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: ...