(self)
| 2452 | |
| 2453 | class 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: |
nothing calls this directly
no test coverage detected