summaryrefslogtreecommitdiff
path: root/tests/test_isort.py
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2019-12-29 22:52:12 -0800
committerTimothy Crosley <timothy.crosley@gmail.com>2019-12-29 22:52:12 -0800
commitc54b3dd4620f9b3e7ac127c583ecb029fb90f1b7 (patch)
tree80ced7283e6e43c6359e17ecb1b7bd536a562aca /tests/test_isort.py
parent4edfd1d6c8ba741ac24594ff95847451b94db293 (diff)
downloadisort-c54b3dd4620f9b3e7ac127c583ecb029fb90f1b7.tar.gz
Fix support for multi-line comments ending in what appear to be comments
Diffstat (limited to 'tests/test_isort.py')
-rw-r--r--tests/test_isort.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test_isort.py b/tests/test_isort.py
index e5072b0f..451af9e2 100644
--- a/tests/test_isort.py
+++ b/tests/test_isort.py
@@ -4213,3 +4213,28 @@ import os
import sys
"""
assert SortImports(file_contents=test_input).output == test_input
+
+
+def test_comment_look_alike():
+ """Test to ensure isort will handle what looks like a single line comment
+ at the end of a multi-line comment.
+ """
+ test_input = '''
+"""This is a multi-line comment
+
+ending with what appears to be a single line comment
+# Single Line Comment"""
+import sys
+import os
+'''
+ assert (
+ SortImports(file_contents=test_input).output
+ == '''
+"""This is a multi-line comment
+
+ending with what appears to be a single line comment
+# Single Line Comment"""
+import os
+import sys
+'''
+ )