From: Nikita Sobolev Date: Tue, 25 Oct 2022 13:33:34 +0000 (+0300) Subject: Use more precise exception types in `assertRaises` in typing tests (#98650) X-Git-Tag: v3.12.0a2~254 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=45c89358b71e4638455e75ba6e60b42c511bbc2a;p=thirdparty%2FPython%2Fcpython.git Use more precise exception types in `assertRaises` in typing tests (#98650) --- diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index ab8e71735c4d..26c3e0294ce6 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3575,11 +3575,11 @@ class GenericTests(BaseTestCase): self.assertEqual(D.__parameters__, ()) - with self.assertRaises(Exception): + with self.assertRaises(TypeError): D[int] - with self.assertRaises(Exception): + with self.assertRaises(TypeError): D[Any] - with self.assertRaises(Exception): + with self.assertRaises(TypeError): D[T] def test_new_with_args(self):