File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -837,24 +837,28 @@ def test_skip_within_file() -> None:
837
837
with pytest .raises (FileSkipped ):
838
838
isort .code (test_input , known_third_party = ["django" ])
839
839
840
+
840
841
def test_skip_comment_without_space_after_hash () -> None :
841
842
"""Ensure skipping a whole file works."""
842
843
test_input = "#isort: skip_file\n import django\n import myproject\n "
843
844
with pytest .raises (FileSkipped ):
844
845
isort .code (test_input , known_third_party = ["django" ])
845
846
847
+
846
848
def test_skip_comment_is_no_comment () -> None :
847
849
"""Ensure skipping a whole file works."""
848
- test_input = " content = \ " # isort:skip_file\" "
850
+ test_input = ' content = "# isort:skip_file"'
849
851
test_output = isort .code (test_input )
850
852
assert test_output == test_input
851
853
854
+
852
855
def test_force_to_top () -> None :
853
856
"""Ensure forcing a single import to the top of its category works as expected."""
854
857
test_input = "import lib6\n import lib2\n import lib5\n import lib1\n "
855
858
test_output = isort .code (test_input , force_to_top = ["lib5" ])
856
859
assert test_output == "import lib5\n import lib1\n import lib2\n import lib6\n "
857
860
861
+
858
862
def test_add_imports () -> None :
859
863
"""Ensures adding imports works as expected."""
860
864
test_input = "import lib6\n import lib2\n import lib5\n import lib1\n \n "
You can’t perform that action at this time.
0 commit comments