mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.13] gh-122546: use same filename for different exceptions in new repl (GH-123217) (#123226)
This commit is contained in:
parent
5148e03f0f
commit
5271f8fead
4 changed files with 14 additions and 11 deletions
|
@ -1100,6 +1100,16 @@ class TestMain(TestCase):
|
|||
self.assertIn("spam", output)
|
||||
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)
|
||||
|
||||
def run_repl(
|
||||
self,
|
||||
repl_input: str | list[str],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue