https://github.com/python/cpython/commit/7d995ea9fd45258efa8d51f70b92e0cacec74f38
commit: 7d995ea9fd45258efa8d51f70b92e0cacec74f38
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: ambv <[email protected]>
date: 2025-05-19T14:51:46Z
summary:

[3.14] gh-134214: Fix test case in pyrepl (gh-134223) (gh-134229)

(cherry picked from commit faebf87b3716f7103ee5410456972db36f4b3ada)

Co-authored-by: Jessica Temporal <[email protected]>

files:
M Lib/test/test_pyrepl/test_pyrepl.py

diff --git a/Lib/test/test_pyrepl/test_pyrepl.py 
b/Lib/test/test_pyrepl/test_pyrepl.py
index f80755b3368f8f..a1cfbe4c3cadb7 100644
--- a/Lib/test/test_pyrepl/test_pyrepl.py
+++ b/Lib/test/test_pyrepl/test_pyrepl.py
@@ -1055,11 +1055,15 @@ def test_parse(self):
                 self.assertEqual(actual, parsed)
             # The parser should not get tripped up by any
             # other preceding statements
-            code = f'import xyz\n{code}'
-            with self.subTest(code=code):
+            _code = f'import xyz\n{code}'
+            parser = ImportParser(_code)
+            actual = parser.parse()
+            with self.subTest(code=_code):
                 self.assertEqual(actual, parsed)
-            code = f'import xyz;{code}'
-            with self.subTest(code=code):
+            _code = f'import xyz;{code}'
+            parser = ImportParser(_code)
+            actual = parser.parse()
+            with self.subTest(code=_code):
                 self.assertEqual(actual, parsed)
 
     def test_parse_error(self):

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to