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

(cherry picked from commit 067c03bf40)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Nikita Sobolev 2022-02-07 11:48:20 +03:00 committed by GitHub
parent 3ceff9968b
commit c1ff4cb98b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 16 deletions

View file

@ -431,6 +431,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):
@ -458,6 +460,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