File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 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:
837837 with pytest .raises (FileSkipped ):
838838 isort .code (test_input , known_third_party = ["django" ])
839839
840+
840841def test_skip_comment_without_space_after_hash () -> None :
841842 """Ensure skipping a whole file works."""
842843 test_input = "#isort: skip_file\n import django\n import myproject\n "
843844 with pytest .raises (FileSkipped ):
844845 isort .code (test_input , known_third_party = ["django" ])
845846
847+
846848def test_skip_comment_is_no_comment () -> None :
847849 """Ensure skipping a whole file works."""
848- test_input = " content = \ " # isort:skip_file\" "
850+ test_input = ' content = "# isort:skip_file"'
849851 test_output = isort .code (test_input )
850852 assert test_output == test_input
851853
854+
852855def test_force_to_top () -> None :
853856 """Ensure forcing a single import to the top of its category works as expected."""
854857 test_input = "import lib6\n import lib2\n import lib5\n import lib1\n "
855858 test_output = isort .code (test_input , force_to_top = ["lib5" ])
856859 assert test_output == "import lib5\n import lib1\n import lib2\n import lib6\n "
857860
861+
858862def test_add_imports () -> None :
859863 """Ensures adding imports works as expected."""
860864 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