Skip to content

Commit 567fd22

Browse files
committed
Add failing test for multiline comments
1 parent c1341c4 commit 567fd22

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/unit/adaptors/test_importscanner.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,40 @@ def test_get_raw_imports(self):
927927
),
928928
}
929929

930+
@pytest.mark.xfail(strict=True)
931+
def test_multiline_comments(self):
932+
module_contents = dedent(
933+
"""\
934+
import a
935+
936+
FOO = \"\"\"
937+
...
938+
\"\"\"
939+
940+
\"\"\"import b
941+
import c
942+
\"\"\"
943+
944+
import d
945+
"""
946+
)
947+
raw_imported_objects = ImportScanner._get_raw_imported_objects(module_contents)
948+
949+
assert raw_imported_objects == {
950+
_ImportedObject(
951+
name="a",
952+
line_number=1,
953+
line_contents="import a",
954+
typechecking_only=False,
955+
),
956+
_ImportedObject(
957+
name="d",
958+
line_number=11,
959+
line_contents="import d",
960+
typechecking_only=False,
961+
),
962+
}
963+
930964

931965
@pytest.mark.parametrize(
932966
"is_package,imported_object_name,expected_absolute_imported_object_name",

0 commit comments

Comments
 (0)