MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_close

Method test_close

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

Source from the content-addressed store, hash-verified

808 self.assertFalse(stack._exit_callbacks)
809
810 def test_close(self):
811 result = []
812 with self.exit_stack() as stack:
813 @stack.callback
814 def _exit():
815 result.append(1)
816 self.assertIsNotNone(_exit)
817 stack.close()
818 result.append(2)
819 self.assertEqual(result, [1, 2])
820
821 def test_pop_all(self):
822 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