Skip to content

Commit 26f1961

Browse files
committed
[3.10] pythongh-102444: Fix minor bugs in test_typing highlighted by pyflakes (python#102445)
(cherry picked from commit 96e1022)
1 parent 9cec602 commit 26f1961

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

Lib/test/test_typing.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -4752,16 +4752,6 @@ class C:
47524752
self.assertEqual(get_type_hints(C, globals())['classvar'], ClassVar[int])
47534753
self.assertEqual(get_type_hints(C, globals())['const'], Final[int])
47544754

4755-
def test_hash_eq(self):
4756-
self.assertEqual(len({Annotated[int, 4, 5], Annotated[int, 4, 5]}), 1)
4757-
self.assertNotEqual(Annotated[int, 4, 5], Annotated[int, 5, 4])
4758-
self.assertNotEqual(Annotated[int, 4, 5], Annotated[str, 4, 5])
4759-
self.assertNotEqual(Annotated[int, 4], Annotated[int, 4, 4])
4760-
self.assertEqual(
4761-
{Annotated[int, 4, 5], Annotated[int, 4, 5], Annotated[T, 4, 5]},
4762-
{Annotated[int, 4, 5], Annotated[T, 4, 5]}
4763-
)
4764-
47654755
def test_cannot_subclass(self):
47664756
with self.assertRaisesRegex(TypeError, "Cannot subclass .*Annotated"):
47674757
class C(Annotated):
@@ -5309,7 +5299,7 @@ def test_special_attrs2(self):
53095299
self.assertEqual(fr.__module__, 'typing')
53105300
# Forward refs are currently unpicklable.
53115301
for proto in range(pickle.HIGHEST_PROTOCOL + 1):
5312-
with self.assertRaises(TypeError) as exc:
5302+
with self.assertRaises(TypeError):
53135303
pickle.dumps(fr, proto)
53145304

53155305
self.assertEqual(SpecialAttrsTests.TypeName.__name__, 'TypeName')

0 commit comments

Comments
 (0)