#4547: When debugging a very large function, it was not always

possible to update the lineno attribute of the current frame.
This commit is contained in:
Amaury Forgeot d'Arc 2009-06-01 20:53:18 +00:00
parent 09daad9825
commit b02ceda3a5
3 changed files with 22 additions and 2 deletions

View file

@ -740,6 +740,23 @@ class JumpTestCase(unittest.TestCase):
def test_19_no_jump_without_trace_function(self):
no_jump_without_trace_function()
def test_20_large_function(self):
d = {}
exec("""def f(output): # line 0
x = 0 # line 1
y = 1 # line 2
''' # line 3
%s # lines 4-1004
''' # line 1005
x += 1 # line 1006
output.append(x) # line 1007
return""" % ('\n' * 1000,), d)
f = d['f']
f.jump = (2, 1007)
f.output = [0]
self.run_test(f)
def test_jump_to_firstlineno(self):
# This tests that PDB can jump back to the first line in a
# file. See issue #1689458. It can only be triggered in a