8000 bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints. by hjzin · Pull Request #24646 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints. #24646

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 11 commits into from
Jun 11, 2021
Prev Previous commit
Next Next commit
add unit test for bpo-43318
  • Loading branch information
huzhaojie committed Jun 11, 2021
commit aef3abd7be5ce467be1a959045f42dcf62767e06
28 changes: 28 additions & 0 deletions Lib/test/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,34 @@ def test_pdb_issue_20766():
pdb 2: <built-in function default_int_handler>
"""

def test_pdb_issue_43318():
"""issue-43318:pdb can't output the prompt message when successfully clear breakpoints by filename:lineno

>>> def test_function():
... import pdb; pdb.Pdb(nosigint=True, readrc=False).set_trace()
... print(1)
... print(2)
... print(3)
... print(4)

>>> with PdbTestInput([ # doctest: +NORMALIZE_WHITESPACE
... 'break 3',
... 'clear <doctest test.test_pdb.test_pdb_issue_43318[0]>:3',
... 'continue'
... ]):
... test_function()
> <doctest test.test_pdb.test_pdb_issue_43318[0]>(3)test_function()
-> print(1)
(Pdb) break 3
Breakpoint 6 at <doctest test.test_pdb.test_pdb_issue_43318[0]>:3
(Pdb) clear <doctest test.test_pdb.test_pdb_issue_43318[0]>:3
Deleted breakpoint 6 at <doctest test.test_pdb.test_pdb_issue_43318[0]>:3
(Pdb) continue
1
2
3
4
"""

class PdbTestCase(unittest.TestCase):
def tearDown(self):
Expand Down
0