summaryrefslogtreecommitdiff
path: root/test_isort.py
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2019-02-23 14:22:07 -0800
committerTimothy Crosley <timothy.crosley@gmail.com>2019-02-23 14:22:07 -0800
commit4ee2fa80f4fe5a1441309a9620aa0e9f8cf05f38 (patch)
tree6c1d66e63c46bc937e1e7f927515fefebc33e965 /test_isort.py
parentb03c5b7506ec9307b4d2c37dec2f2a075c8f9fc8 (diff)
downloadisort-4ee2fa80f4fe5a1441309a9620aa0e9f8cf05f38.tar.gz
Fix issue 576
Diffstat (limited to 'test_isort.py')
-rw-r--r--test_isort.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test_isort.py b/test_isort.py
index 51b34357..bdd4453c 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -2708,3 +2708,10 @@ def test_safety_excludes(tmpdir, enabled):
else:
assert file_names == {'.tox/verysafe.py', 'lib/python3.7/importantsystemlibrary.py', 'victim.py'}
assert not skipped
+
+
+def test_comments_not_removed_issue_576():
+ test_input = ('import distutils\n'
+ '# this comment is important and should not be removed\n'
+ 'from sys import api_version as api_version\n')
+ assert SortImports(file_contents=test_input).output == test_input