gh-111201: fix auto-indent in pyrepl for muliple pound comments (#123196)

This commit is contained in:
Arnon Yaari 2024-09-06 10:33:40 +03:00 committed by GitHub
parent 67957ea77d
commit d683f49a7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View file

@ -466,6 +466,24 @@ class TestPyReplAutoindent(TestCase):
output = multiline_input(reader)
self.assertEqual(output, output_code)
def test_auto_indent_with_multicomment(self):
# fmt: off
events = code_to_events(
"def f(): ## foo\n"
"pass\n\n"
)
output_code = (
"def f(): ## foo\n"
" pass\n"
" "
)
# fmt: on
reader = self.prepare_reader(events)
output = multiline_input(reader)
self.assertEqual(output, output_code)
def test_auto_indent_ignore_comments(self):
# fmt: off
events = code_to_events(