diff options
author | Sergey B Kirpichev <skirpichev@gmail.com> | 2024-05-29 06:57:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-29 06:57:50 (GMT) |
commit | 86d1a1aa8841ea182eaf434ae6b942b3e93f58db (patch) | |
tree | cf1ccb08df50de774df8d0cca2af903905437040 /Lib/test/test_pyrepl/test_interact.py | |
parent | c0faade891e6ccb61137041fe10cc05e5fa8d534 (diff) | |
download | cpython-86d1a1aa8841ea182eaf434ae6b942b3e93f58db.zip cpython-86d1a1aa8841ea182eaf434ae6b942b3e93f58db.tar.gz cpython-86d1a1aa8841ea182eaf434ae6b942b3e93f58db.tar.bz2 |
gh-119555: catch SyntaxError from compile() in the InteractiveColoredConsole (#119557)
Diffstat (limited to 'Lib/test/test_pyrepl/test_interact.py')
-rw-r--r-- | Lib/test/test_pyrepl/test_interact.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_pyrepl/test_interact.py b/Lib/test/test_pyrepl/test_interact.py index 6ebd51f..4d01ea7 100644 --- a/Lib/test/test_pyrepl/test_interact.py +++ b/Lib/test/test_pyrepl/test_interact.py @@ -94,6 +94,14 @@ class TestSimpleInteract(unittest.TestCase): with patch.object(console, "showsyntaxerror") as mock_showsyntaxerror: console.runsource(source) mock_showsyntaxerror.assert_called_once() + source = dedent("""\ + match 1: + case {0: _, 0j: _}: + pass + """) + with patch.object(console, "showsyntaxerror") as mock_showsyntaxerror: + console.runsource(source) + mock_showsyntaxerror.assert_called_once() def test_no_active_future(self): console = InteractiveColoredConsole() |