From abc1a8c61c82860e135b1b1fcb01713f8b911cd8 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Tue, 25 Oct 2022 07:19:37 -0700 Subject: [PATCH] Use more precise exception types in `assertRaises` in typing tests (GH-98650) (cherry picked from commit 45c89358b71e4638455e75ba6e60b42c511bbc2a) Co-authored-by: Nikita Sobolev --- Lib/test/test_typing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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): -- 2.47.3