diff options
author | Sergey B Kirpichev <skirpichev@gmail.com> | 2024-08-22 11:55:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-22 11:55:30 (GMT) |
commit | 3d7b1a526d858496add5b188c790b8d5fe73b06b (patch) | |
tree | c990713e27b5edba168bfb032b4294a625401c3a /Lib/test | |
parent | 427b106162c7467de8a84476a053dfba9ef16dfa (diff) | |
download | cpython-3d7b1a526d858496add5b188c790b8d5fe73b06b.zip cpython-3d7b1a526d858496add5b188c790b8d5fe73b06b.tar.gz cpython-3d7b1a526d858496add5b188c790b8d5fe73b06b.tar.bz2 |
gh-122546: use same filename for different exceptions in new repl (#123217)
* gh-122546: use same filename for different exceptions in new repl
* +1
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_pyrepl/test_pyrepl.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index e11ec74..7798497 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1101,6 +1101,16 @@ class TestMain(TestCase): self.assertNotEqual(pathlib.Path(hfile.name).stat().st_size, 0) @force_not_colorized + def test_correct_filename_in_syntaxerrors(self): + env = os.environ.copy() + commands = "a b c\nexit()\n" + output, exit_code = self.run_repl(commands, env=env) + if "can't use pyrepl" in output: + self.skipTest("pyrepl not available") + self.assertIn("SyntaxError: invalid syntax", output) + self.assertIn("<python-input-0>", output) + + @force_not_colorized def test_proper_tracebacklimit(self): env = os.environ.copy() for set_tracebacklimit in [True, False]: |