summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorChristian Decker <christian.decker@lookslikematrix.de>2021-10-27 11:18:06 +0200
committerChristian Decker <christian.decker@lookslikematrix.de>2021-10-27 11:18:06 +0200
commit31c9daa84723e956039990f58d996bf24a6fe64c (patch)
tree46ee0adc588b10f33fd0e408d40d7972e1c70f52 /tests/unit
parent0c24aceb2a30e7e6709282143ea13acf86030cd0 (diff)
downloadisort-31c9daa84723e956039990f58d996bf24a6fe64c.tar.gz
only skip real comments
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test_isort.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/unit/test_isort.py b/tests/unit/test_isort.py
index b0534142..3467569f 100644
--- a/tests/unit/test_isort.py
+++ b/tests/unit/test_isort.py
@@ -837,6 +837,11 @@ def test_skip_within_file() -> None:
with pytest.raises(FileSkipped):
isort.code(test_input, known_third_party=["django"])
+def test_skip_comment_is_no_comment() -> None:
+ """Ensure skipping a whole file works."""
+ test_input = "content = \"# isort:skip_file\""
+ test_output = isort.code(test_input)
+ assert test_output == test_input
def test_force_to_top() -> None:
"""Ensure forcing a single import to the top of its category works as expected."""