Skip to content

Commit 7d995ea

Browse files
[3.14] pythongh-134214: Fix test case in pyrepl (pythongh-134223) (pythongh-134229)
(cherry picked from commit faebf87) Co-authored-by: Jessica Temporal <[email protected]>
1 parent a3c3d6f commit 7d995ea

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Lib/test/test_pyrepl/test_pyrepl.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,11 +1055,15 @@ def test_parse(self):
10551055
self.assertEqual(actual, parsed)
10561056
# The parser should not get tripped up by any
10571057
# other preceding statements
1058-
code = f'import xyz\n{code}'
1059-
with self.subTest(code=code):
1058+
_code = f'import xyz\n{code}'
1059+
parser = ImportParser(_code)
1060+
actual = parser.parse()
1061+
with self.subTest(code=_code):
10601062
self.assertEqual(actual, parsed)
1061-
code = f'import xyz;{code}'
1062-
with self.subTest(code=code):
1063+
_code = f'import xyz;{code}'
1064+
parser = ImportParser(_code)
1065+
actual = parser.parse()
1066+
with self.subTest(code=_code):
10631067
self.assertEqual(actual, parsed)
10641068

10651069
def test_parse_error(self):

0 commit comments

Comments
 (0)