]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-121605: Fix test hang when pyrepl is not available (GH-121820)
authorSam Gross <colesbury@gmail.com>
Mon, 15 Jul 2024 22:50:16 +0000 (18:50 -0400)
committerGitHub <noreply@github.com>
Mon, 15 Jul 2024 22:50:16 +0000 (00:50 +0200)
The fallback repl does not support "exit" without parentheses, so the
test would hang until the timeout expired.

Lib/test/test_pyrepl/test_pyrepl.py

index 543a13e0e697a80c5999aa036a7323199e8f9181..2b1f8c3cea42f9db95a92ff00327a5f414241dca 100644 (file)
@@ -901,7 +901,7 @@ class TestMain(TestCase):
     def test_exposed_globals_in_repl(self):
         pre = "['__annotations__', '__builtins__'"
         post = "'__loader__', '__name__', '__package__', '__spec__']"
-        output, exit_code = self.run_repl(["sorted(dir())", "exit"])
+        output, exit_code = self.run_repl(["sorted(dir())", "exit()"])
         if "can't use pyrepl" in output:
             self.skipTest("pyrepl not available")
         self.assertEqual(exit_code, 0)