Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdecker1201 committed Oct 28, 2021
1 parent f0f4645 commit 4e3f64b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/unit/test_isort.py
Expand Up @@ -837,24 +837,28 @@ def test_skip_within_file() -> None:
with pytest.raises(FileSkipped):
isort.code(test_input, known_third_party=["django"])


def test_skip_comment_without_space_after_hash() -> None:
"""Ensure skipping a whole file works."""
test_input = "#isort: 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\""
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."""
test_input = "import lib6\nimport lib2\nimport lib5\nimport lib1\n"
test_output = isort.code(test_input, force_to_top=["lib5"])
assert test_output == "import lib5\nimport lib1\nimport lib2\nimport lib6\n"


def test_add_imports() -> None:
"""Ensures adding imports works as expected."""
test_input = "import lib6\nimport lib2\nimport lib5\nimport lib1\n\n"
Expand Down

0 comments on commit 4e3f64b

Please sign in to comment.