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