diff options
-rw-r--r-- | tests/test_isort.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_isort.py b/tests/test_isort.py index a0f5dfc0..2580fae7 100644 --- a/tests/test_isort.py +++ b/tests/test_isort.py @@ -4771,3 +4771,15 @@ try: import bar """ assert SortImports(file_contents=test_input).output == test_input + + +def test_comments_top_of_file(): + """Test to ensure comments at top of file are correctly handled. See issue #1091.""" + test_input = """# comment 1 + +# comment 2 +# comment 3 +# comment 4 +from foo import * +""" + assert SortImports(file_contents=test_input).output == test_input |