diff options
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_sys_settrace.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index cf3976c..ea2bb29 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -671,6 +671,14 @@ def no_jump_to_non_integers(output): no_jump_to_non_integers.jump = (2, "Spam") no_jump_to_non_integers.output = [True] +def jump_across_with(output): + with open(support.TESTFN, "wb") as fp: + pass + with open(support.TESTFN, "wb") as fp: + pass +jump_across_with.jump = (1, 3) +jump_across_with.output = [] + # This verifies that you can't set f_lineno via _getframe or similar # trickery. def no_jump_without_trace_function(): @@ -740,6 +748,9 @@ class JumpTestCase(unittest.TestCase): self.run_test(no_jump_to_non_integers) def test_19_no_jump_without_trace_function(self): no_jump_without_trace_function() + def test_jump_across_with(self): + self.addCleanup(support.unlink, support.TESTFN) + self.run_test(jump_across_with) def test_20_large_function(self): d = {} |