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

Method test_nullcontext

Lib/test/test_contextlib.py:434–439  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

432
433class NullcontextTestCase(unittest.TestCase):
434 def test_nullcontext(self):
435 class C:
436 pass
437 c = C()
438 with nullcontext(c) as c_in:
439 self.assertIs(c_in, c)
440
441
442class FileContextTestCase(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

nullcontextClass · 0.85
CClass · 0.70
assertIsMethod · 0.45

Tested by

no test coverage detected