8000 gh-59013: Set breakpoint on the first executable line in pdb when using `break func` by gaogaotiantian · Pull Request #112470 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-59013: Set breakpoint on the first executable line in pdb when using break func #112470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test name, add multiline test
  • Loading branch information
gaogaotiantian committed Nov 27, 2023
commit 9c33910772f347b9c11902697f69a3f394eef51b
12 changes: 11 additions & 1 deletion Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2617,7 +2617,7 @@ def bœr():
('bœr', 2),
)

def test_find_function_empty_file(self):
def test_find_function_first_executable_line(self):
code = textwrap.dedent("""\
def foo(): pass

Expand All @@ -2627,10 +2627,20 @@ def bar():
def baz():
# comment
pass

def mul():
# code on multiple lines
code = compile(
'def f()',
'<string>',
'exec',
)
""").encode()

self._assert_find_function(code, 'foo', ('foo', 1))
self._assert_find_function(code, 'bar', ('bar', 4))
self._assert_find_function(code, 'baz', ('baz', 8))
self._assert_find_function(code, 'mul', ('mul', 12))

def test_issue7964(self):
# open the file as binary so we can force \r\n newline
Expand Down
0