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

Method setUp

Lib/test/test_builtin.py:2454–2466  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2452
2453class TestBreakpoint(unittest.TestCase):
2454 def setUp(self):
2455 # These tests require a clean slate environment. For example, if the
2456 # test suite is run with $PYTHONBREAKPOINT set to something else, it
2457 # will mess up these tests. Similarly for sys.breakpointhook.
2458 # Cleaning the slate here means you can't use breakpoint() to debug
2459 # these tests, but I think that's okay. Just use pdb.set_trace() if
2460 # you must.
2461 self.resources = ExitStack()
2462 self.addCleanup(self.resources.close)
2463 self.env = self.resources.enter_context(EnvironmentVarGuard())
2464 del self.env['PYTHONBREAKPOINT']
2465 self.resources.enter_context(
2466 swap_attr(sys, 'breakpointhook', sys.__breakpointhook__))
2467
2468 def test_breakpoint(self):
2469 with patch('pdb.set_trace') as mock:

Callers

nothing calls this directly

Calls 5

ExitStackClass · 0.90
EnvironmentVarGuardClass · 0.90
swap_attrFunction · 0.90
addCleanupMethod · 0.80
enter_contextMethod · 0.80

Tested by

no test coverage detected