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

(cherry picked from commit faebf87b37)

Co-authored-by: Jessica Temporal <jtemporal@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-05-19 16:51:46 +02:00 committed by GitHub
parent a3c3d6f0ef
commit 7d995ea9fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1055,11 +1055,15 @@ class TestPyReplModuleCompleter(TestCase):
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):