]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] gh-102444: Fix minor bugs in `test_typing` highlighted by pyflakes (#102445...
authorAlex Waygood <Alex.Waygood@Gmail.com>
Sun, 5 Mar 2023 22:16:08 +0000 (22:16 +0000)
committerGitHub <noreply@github.com>
Sun, 5 Mar 2023 22:16:08 +0000 (22:16 +0000)
(cherry picked from commit 96e1022)

Lib/test/test_typing.py

index 2be4195b8565410b0d8b8bbf818d01b8abdb5c9e..4e0a4f51fd0786f718f5dc8f5a28de754766ad04 100644 (file)
@@ -4752,16 +4752,6 @@ class AnnotatedTests(BaseTestCase):
         self.assertEqual(get_type_hints(C, globals())['classvar'], ClassVar[int])
         self.assertEqual(get_type_hints(C, globals())['const'], Final[int])
 
-    def test_hash_eq(self):
-        self.assertEqual(len({Annotated[int, 4, 5], Annotated[int, 4, 5]}), 1)
-        self.assertNotEqual(Annotated[int, 4, 5], Annotated[int, 5, 4])
-        self.assertNotEqual(Annotated[int, 4, 5], Annotated[str, 4, 5])
-        self.assertNotEqual(Annotated[int, 4], Annotated[int, 4, 4])
-        self.assertEqual(
-            {Annotated[int, 4, 5], Annotated[int, 4, 5], Annotated[T, 4, 5]},
-            {Annotated[int, 4, 5], Annotated[T, 4, 5]}
-        )
-
     def test_cannot_subclass(self):
         with self.assertRaisesRegex(TypeError, "Cannot subclass .*Annotated"):
             class C(Annotated):
@@ -5309,7 +5299,7 @@ class SpecialAttrsTests(BaseTestCase):
         self.assertEqual(fr.__module__, 'typing')
         # Forward refs are currently unpicklable.
         for proto in range(pickle.HIGHEST_PROTOCOL + 1):
-            with self.assertRaises(TypeError) as exc:
+            with self.assertRaises(TypeError):
                 pickle.dumps(fr, proto)
 
         self.assertEqual(SpecialAttrsTests.TypeName.__name__, 'TypeName')