Skip to content
Prev Previous commit
Next Next commit
fix tests
  • Loading branch information
hauntsaninja
hauntsaninja committed Mar 13, 2022
commit 4927e78b9014637ab87f99842f3c3db1cbf458e6
7 changes: 5 additions & 2 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@ class Mock(Any): pass
class Something: pass
self.assertFalse(issubclass(Something, Any))

class MockSomething(Something, Any): pass
class MockSomething(Something, Mock): pass
self.assertTrue(issubclass(MockSomething, Any))
ms = MockSomething()
self.assertIsInstance(ms, Mock)
self.assertIsInstance(ms, MockSomething)
self.assertIsInstance(ms, Something)
with self.assertRaises(TypeError):
# TODO(address in code review): this seems undesirable, should we abandon instancecheck?
self.assertIsInstance(ms, Mock)

def test_cannot_instantiate(self):
with self.assertRaises(TypeError):
Expand Down