summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-10-25 14:12:59 (GMT)
committerGitHub <noreply@github.com>2022-10-25 14:12:59 (GMT)
commit750e5048009e36e7c3ca9f396fc82cbcfaf8bd5e (patch)
tree47b12b0ccbeac12ea4722519aabbdc7592a25129
parenta86a7b827bd679b87f619329d3c3f870fa01ee0a (diff)
downloadcpython-750e5048009e36e7c3ca9f396fc82cbcfaf8bd5e.zip
cpython-750e5048009e36e7c3ca9f396fc82cbcfaf8bd5e.tar.gz
cpython-750e5048009e36e7c3ca9f396fc82cbcfaf8bd5e.tar.bz2
Use more precise exception types in `assertRaises` in typing tests (GH-98650)
(cherry picked from commit 45c89358b71e4638455e75ba6e60b42c511bbc2a) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
-rw-r--r--Lib/test/test_typing.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py
index 3f38e30..34f9444 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):