Skip to content

Commit 27bb2ec

Browse files
authored
Add comment about why we remove docstrings on test_assertrewrite
As explained in #2870
1 parent fd7bfa3 commit 27bb2ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

testing/test_assertrewrite.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ class TestAssertionRewrite(object):
6565
def test_place_initial_imports(self):
6666
s = """'Doc string'\nother = stuff"""
6767
m = rewrite(s)
68+
# Module docstrings in 3.7 are part of Module node, it's not in the body
69+
# so we remove it so the following body items have the same indexes on
70+
# all Python versions
6871
if sys.version_info < (3, 7):
6972
assert isinstance(m.body[0], ast.Expr)
7073
assert isinstance(m.body[0].value, ast.Str)

0 commit comments

Comments
 (0)