Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit faebf87

Browse files
authoredMay 19, 2025··
gh-134214: Fix test case in pyrepl (gh-134223)
1 parent cc9add6 commit faebf87

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)
Please sign in to comment.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant