Skip to content

Commit

Permalink
Add failing test for issue #1488
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Sep 19, 2020
1 parent 7431db7 commit 2c4e6d5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/unit/test_regressions.py
Expand Up @@ -949,3 +949,21 @@ def test_import_sorting_shouldnt_be_endless_with_headers_issue_1454():
import_heading_thirdparty="related third party imports",
show_diff=True,
)


def test_isort_should_leave_non_import_from_lines_alone():
"""isort should never mangle non-import from statements.
See: https://github.com/PyCQA/isort/issues/1488
"""
raise_from_should_be_ignored = """
raise SomeException("Blah") \
from exceptionsInfo.popitem()[1]
"""
assert isort.check(raise_from_should_be_ignored, show_diff=True)

yield_from_should_be_ignored = """
def generator_function():
yield \
from []
"""
assert isort.check(raise_from_should_be_ignored, show_diff=True)

0 comments on commit 2c4e6d5

Please sign in to comment.