summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pyrepl/test_pyrepl.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_pyrepl/test_pyrepl.py')
-rw-r--r--Lib/test/test_pyrepl/test_pyrepl.py10
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]: