##// END OF EJS Templates
TST: Restore original trace function
Nikita Kniazev -
Show More
@@ -247,13 +247,19 b' def test_interruptible_core_debugger():'
247 else:
247 else:
248 raise AssertionError("input() should only be called once!")
248 raise AssertionError("input() should only be called once!")
249
249
250 tracer_orig = sys.gettrace()
251 try:
250 with patch.object(builtins, "input", raising_input):
252 with patch.object(builtins, "input", raising_input):
251 debugger.InterruptiblePdb().set_trace()
253 debugger.InterruptiblePdb().set_trace()
252 # The way this test will fail is by set_trace() never exiting,
254 # The way this test will fail is by set_trace() never exiting,
253 # resulting in a timeout by the test runner. The alternative
255 # resulting in a timeout by the test runner. The alternative
254 # implementation would involve a subprocess, but that adds issues with
256 # implementation would involve a subprocess, but that adds issues
255 # interrupting subprocesses that are rather complex, so it's simpler
257 # with interrupting subprocesses that are rather complex, so it's
256 # just to do it this way.
258 # simpler just to do it this way.
259 finally:
260 # restore the original trace function
261 sys.settrace(tracer_orig)
262
257
263
258 @skip_win32
264 @skip_win32
259 def test_xmode_skip():
265 def test_xmode_skip():
General Comments 0
You need to be logged in to leave comments. Login now