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

Method test_contextmanager

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

Source from the content-addressed store, hash-verified

7983class OtherABCTests(BaseTestCase):
7984
7985 def test_contextmanager(self):
7986 @contextlib.contextmanager
7987 def manager():
7988 yield 42
7989
7990 cm = manager()
7991 self.assertIsInstance(cm, typing.ContextManager)
7992 self.assertNotIsInstance(42, typing.ContextManager)
7993
7994 def test_contextmanager_type_params(self):
7995 cm1 = typing.ContextManager[int]

Callers

nothing calls this directly

Calls 3

managerClass · 0.85
assertIsInstanceMethod · 0.80
assertNotIsInstanceMethod · 0.80

Tested by

no test coverage detected