diff options
author | Timothy Crosley <timothy.crosley@gmail.com> | 2020-01-13 21:44:22 -0800 |
---|---|---|
committer | Timothy Crosley <timothy.crosley@gmail.com> | 2020-01-13 21:44:22 -0800 |
commit | be0ae7b5c7d92e019ab514880f26a7a88fe7eb65 (patch) | |
tree | c778c95fba28bc2745f4f49d5a0aecf875f36e12 | |
parent | 500bafabbd51a6005c11a00c4738a2438990e48a (diff) | |
download | isort-be0ae7b5c7d92e019ab514880f26a7a88fe7eb65.tar.gz |
Add test case for issue 1091: comments at top of file
-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 |