gh-134214: Fix test case in pyrepl (gh-134223)

This commit is contained in:
Jessica Temporal 2025-05-19 10:26:04 -04:00 committed by GitHub
parent cc9add695d
commit faebf87b37
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):