From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 25 Oct 2022 14:19:37 +0000 (-0700) Subject: Use more precise exception types in `assertRaises` in typing tests (GH-98650) X-Git-Tag: v3.11.1~210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abc1a8c61c82860e135b1b1fcb01713f8b911cd8;p=thirdparty%2FPython%2Fcpython.git Use more precise exception types in `assertRaises` in typing tests (GH-98650) (cherry picked from commit 45c89358b71e4638455e75ba6e60b42c511bbc2a) Co-authored-by: Nikita Sobolev --- diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 298e374e4cfa..b36804216fa2 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3560,11 +3560,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):