From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 25 Oct 2022 14:12:59 +0000 (-0700) Subject: Use more precise exception types in `assertRaises` in typing tests (GH-98650) X-Git-Tag: v3.10.9~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=750e5048009e36e7c3ca9f396fc82cbcfaf8bd5e;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 3f38e30881d4..34f944416070 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -2405,11 +2405,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):