File tree 1 file changed +31
-5
lines changed 1 file changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -956,14 +956,40 @@ def test_isort_should_leave_non_import_from_lines_alone():
956
956
See: https://github.com/PyCQA/isort/issues/1488
957
957
"""
958
958
raise_from_should_be_ignored = """
959
- raise SomeException("Blah") \
960
- from exceptionsInfo.popitem()[1]
959
+ raise SomeException("Blah") \ \
960
+ from exceptionsInfo.popitem()[1]
961
961
"""
962
- assert isort .check (raise_from_should_be_ignored , show_diff = True )
962
+ assert isort .check_code (raise_from_should_be_ignored , show_diff = True )
963
963
964
964
yield_from_should_be_ignored = """
965
965
def generator_function():
966
- yield \
966
+ yield \\
967
967
from []
968
968
"""
969
- assert isort .check (raise_from_should_be_ignored , show_diff = True )
969
+ assert isort .check_code (yield_from_should_be_ignored , show_diff = True )
970
+
971
+ comment_should_not_cause_ignore = """
972
+ # one
973
+
974
+ # two
975
+
976
+
977
+ def function():
978
+ # one \\
979
+ import b
980
+ import a
981
+ """
982
+ assert (
983
+ isort .code (comment_should_not_cause_ignore )
984
+ == """
985
+ # one
986
+
987
+ # two
988
+
989
+
990
+ def function():
991
+ # one \\
992
+ import a
993
+ import b
994
+ """
995
+ )
You can’t perform that action at this time.
0 commit comments