]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use more precise exception types in `assertRaises` in typing tests (#98650)
authorNikita Sobolev <mail@sobolevn.me>
Tue, 25 Oct 2022 13:33:34 +0000 (16:33 +0300)
committerGitHub <noreply@github.com>
Tue, 25 Oct 2022 13:33:34 +0000 (06:33 -0700)
Lib/test/test_typing.py

index ab8e71735c4d681b87f2856848a81c1bbdea679d..26c3e0294ce64cd4a2344d53ec32635894f6056a 100644 (file)
@@ -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):