bpo-46611: add coverage to instance and class checks in typing.py (GH-31078)

This commit is contained in:
Nikita Sobolev 2022-02-07 04:35:48 +03:00 committed by GitHub
parent b556f53785
commit 067c03bf40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 16 deletions

View file

@ -439,6 +439,8 @@ class TupleTests(BaseTestCase):
class MyTuple(tuple):
pass
self.assertIsSubclass(MyTuple, Tuple)
self.assertIsSubclass(Tuple, Tuple)
self.assertIsSubclass(tuple, Tuple)
def test_tuple_instance_type_error(self):
with self.assertRaises(TypeError):
@ -466,6 +468,7 @@ class BaseCallableTests:
with self.assertRaises(TypeError):
issubclass(types.FunctionType, Callable[[int], int])
self.assertIsSubclass(types.FunctionType, Callable)
self.assertIsSubclass(Callable, Callable)
def test_eq_hash(self):
Callable = self.Callable