diff options
author | Christian Decker <christian.decker@lookslikematrix.de> | 2021-10-28 13:56:19 +0200 |
---|---|---|
committer | Christian Decker <christian.decker@lookslikematrix.de> | 2021-10-28 13:56:19 +0200 |
commit | 3c5da48559a4052b47f170c1a3fe3cdd5bd928da (patch) | |
tree | 37fe71fb5a1c52271cb778eafc568fddf7d211db /tests/unit/test_isort.py | |
parent | 4e3f64bf91b50c9d2923c60853e0701ab04f388f (diff) | |
download | isort-3c5da48559a4052b47f170c1a3fe3cdd5bd928da.tar.gz |
use regex to mach file_skip
Diffstat (limited to 'tests/unit/test_isort.py')
-rw-r--r-- | tests/unit/test_isort.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/unit/test_isort.py b/tests/unit/test_isort.py index 05740d29..d9b663d1 100644 --- a/tests/unit/test_isort.py +++ b/tests/unit/test_isort.py @@ -845,6 +845,13 @@ def test_skip_comment_without_space_after_hash() -> None: isort.code(test_input, known_third_party=["django"]) +def test_skip_comment_with_multiline_comment() -> None: + """Ensure skipping a whole file works.""" + test_input = '"""some comment\n\nisort: skip_file\nimport django\nimport myproject\n"""' + 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"' |