Skip to content

Commit abc1a8c

Browse files
Use more precise exception types in assertRaises in typing tests (GH-98650)
(cherry picked from commit 45c8935) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
1 parent 4b68e34 commit abc1a8c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_typing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3560,11 +3560,11 @@ class D(C):
35603560

35613561
self.assertEqual(D.__parameters__, ())
35623562

3563-
with self.assertRaises(Exception):
3563+
with self.assertRaises(TypeError):
35643564
D[int]
3565-
with self.assertRaises(Exception):
3565+
with self.assertRaises(TypeError):
35663566
D[Any]
3567-
with self.assertRaises(Exception):
3567+
with self.assertRaises(TypeError):
35683568
D[T]
35693569

35703570
def test_new_with_args(self):

0 commit comments

Comments
 (0)