diff --git a/gazelle/python/file_parser_test.go b/gazelle/python/file_parser_test.go index 018de033f6..526afc7716 100644 --- a/gazelle/python/file_parser_test.go +++ b/gazelle/python/file_parser_test.go @@ -77,7 +77,7 @@ func TestParseImportStatements(t *testing.T) { }, { name: "import as", - code: "import os as b\nfrom foo import bar as c", + code: "import os as b\nfrom foo import bar as c# 123", filepath: "abc.py", result: []module{ { @@ -157,6 +157,11 @@ func TestParseComments(t *testing.T) { code: "if True:\n # a = 1\n # b = 2", result: []comment{"# a = 1", "# b = 2"}, }, + { + name: "has comment inline", + code: "import os# 123\nfrom pathlib import Path as b#456", + result: []comment{"# 123", "#456"}, + }, } for _, u := range units { t.Run(u.name, func(t *testing.T) {