summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pdb.py
diff options
context:
space:
mode:
authorgaogaotiantian <gaogaotiantian@hotmail.com>2023-03-27 20:37:22 (GMT)
committerGitHub <noreply@github.com>2023-03-27 20:37:22 (GMT)
commit36067532467ec58c87ac9c140e555e1866431981 (patch)
tree4907a023a9f5b03fa5533b08d6829922ac6d2686 /Lib/test/test_pdb.py
parent2cdc5189a6bc3157fddd814662bde99ecfd77529 (diff)
downloadcpython-36067532467ec58c87ac9c140e555e1866431981.zip
cpython-36067532467ec58c87ac9c140e555e1866431981.tar.gz
cpython-36067532467ec58c87ac9c140e555e1866431981.tar.bz2
gh-103023: Add SyntaxError check in pdb's `display` command (#103024)
Co-authored-by: Ɓukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/test/test_pdb.py')
-rw-r--r--Lib/test/test_pdb.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_pdb.py b/Lib/test/test_pdb.py
index e96dc7f..ae9c5d7 100644
--- a/Lib/test/test_pdb.py
+++ b/Lib/test/test_pdb.py
@@ -586,6 +586,8 @@ def test_pdb_display_command():
... a = 4
>>> with PdbTestInput([ # doctest: +ELLIPSIS
+ ... 'display +',
+ ... 'display',
... 'display a',
... 'n',
... 'display',
@@ -600,6 +602,10 @@ def test_pdb_display_command():
... test_function()
> <doctest test.test_pdb.test_pdb_display_command[0]>(4)test_function()
-> a = 1
+ (Pdb) display +
+ Unable to display +: ** raised SyntaxError: invalid syntax **
+ (Pdb) display
+ No expression is being displayed
(Pdb) display a
display a: 0
(Pdb) n