summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Crosley <timothy.crosley@gmail.com>2019-12-27 23:43:44 -0800
committerTimothy Crosley <timothy.crosley@gmail.com>2019-12-27 23:43:44 -0800
commitd0b930680625ed1aae6a445ca06b7a3e1bce7f31 (patch)
tree3fb80f88d0b56f5727adcf997f050f49567ed0cf
parent3f0efe271aa57016ad3c5492fae2a5e47a9d686b (diff)
downloadisort-d0b930680625ed1aae6a445ca06b7a3e1bce7f31.tar.gz
Add test for isort off comment
-rw-r--r--tests/test_isort.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_isort.py b/tests/test_isort.py
index 40b22bb2..e1096aa6 100644
--- a/tests/test_isort.py
+++ b/tests/test_isort.py
@@ -4186,3 +4186,16 @@ def test_isort_nested_imports() -> None:
return True
"""
)
+
+
+def test_isort_off() -> None:
+ """Test that isort can be turned on and off at will using comments"""
+ test_input = """
+import os
+# isort: off
+import os
+import sys
+# isort: on
+import sys
+ """
+ assert SortImports(file_contents=test_input).output == test_input