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

Method test_close

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

Source from the content-addressed store, hash-verified

877 self.assertFalse(stack._exit_callbacks)
878
879 def test_close(self):
880 result = []
881 with self.exit_stack() as stack:
882 @stack.callback
883 def _exit():
884 result.append(1)
885 self.assertIsNotNone(_exit)
886 stack.close()
887 result.append(2)
888 self.assertEqual(result, [1, 2])
889
890 def test_pop_all(self):
891 result = []

Callers

nothing calls this directly

Calls 4

assertIsNotNoneMethod · 0.80
closeMethod · 0.45
appendMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected