Skip to content

Commit

Permalink
Extend testing to include paren case
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Sep 20, 2020
1 parent e74dc82 commit 67fb11b
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions tests/unit/test_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,32 +964,55 @@ def test_isort_should_leave_non_import_from_lines_alone():
yield_from_should_be_ignored = """
def generator_function():
yield \\
from []
from other_function()[1]
"""
assert isort.check_code(yield_from_should_be_ignored, show_diff=True)

comment_should_not_cause_ignore = """
wont_ignore_comment_contiuation = """
# one
# two
def function():
# one \\
# three \\
import b
import a
"""
assert (
isort.code(comment_should_not_cause_ignore)
isort.code(wont_ignore_comment_contiuation)
== """
# one
# two
def function():
# one \\
# three \\
import a
import b
"""
)

will_ignore_if_non_comment_continuation = """
# one
# two
def function():
print \\
import b
import a
"""
assert isort.check_code(will_ignore_if_non_comment_continuation, show_diff=True)

yield_from_parens_should_be_ignored = """
def generator_function():
(
yield
from other_function()[1]
)
"""
assert isort.check_code(yield_from_parens_should_be_ignored, show_diff=True)

0 comments on commit 67fb11b

Please sign in to comment.