From 4ee2fa80f4fe5a1441309a9620aa0e9f8cf05f38 Mon Sep 17 00:00:00 2001 From: Timothy Crosley Date: Sat, 23 Feb 2019 14:22:07 -0800 Subject: Fix issue 576 --- test_isort.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test_isort.py') 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 -- cgit v1.2.1