From dc2755692c7162ddd3ac9a79ca234b2434b5879e Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 25 Oct 2022 16:33:34 +0300 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 298e374e4cfa10..b36804216fa2ba 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -3560,11 +3560,11 @@ class D(C): 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):