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

Method setUp

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

Source from the content-addressed store, hash-verified

2501
2502class TestBreakpoint(unittest.TestCase):
2503 def setUp(self):
2504 # These tests require a clean slate environment. For example, if the
2505 # test suite is run with $PYTHONBREAKPOINT set to something else, it
2506 # will mess up these tests. Similarly for sys.breakpointhook.
2507 # Cleaning the slate here means you can't use breakpoint() to debug
2508 # these tests, but I think that's okay. Just use pdb.set_trace() if
2509 # you must.
2510 self.resources = ExitStack()
2511 self.addCleanup(self.resources.close)
2512 self.env = self.resources.enter_context(EnvironmentVarGuard())
2513 del self.env['PYTHONBREAKPOINT']
2514 self.resources.enter_context(
2515 swap_attr(sys, 'breakpointhook', sys.__breakpointhook__))
2516
2517 def test_breakpoint(self):
2518 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