MCPcopy Index your code
hub / github.com/python/cpython / test_is_protocol

Method test_is_protocol

Lib/test/test_typing.py:4577–4586  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4575 get_protocol_members(ConcreteInherit())
4576
4577 def test_is_protocol(self):
4578 self.assertTrue(is_protocol(Proto))
4579 self.assertTrue(is_protocol(Point))
4580 self.assertFalse(is_protocol(Concrete))
4581 self.assertFalse(is_protocol(Concrete()))
4582 self.assertFalse(is_protocol(Generic))
4583 self.assertFalse(is_protocol(object))
4584
4585 # Protocol is not itself a protocol
4586 self.assertFalse(is_protocol(Protocol))
4587
4588 def test_interaction_with_isinstance_checks_on_superclasses_with_ABCMeta(self):
4589 # Ensure the cache is empty, or this test won't work correctly

Callers

nothing calls this directly

Calls 4

is_protocolFunction · 0.90
assertTrueMethod · 0.80
assertFalseMethod · 0.80
ConcreteClass · 0.70

Tested by

no test coverage detected