Skip to content

Commit

Permalink
Add test for issue #1293
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Jul 8, 2020
1 parent 4eb7352 commit 1685beb
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,20 @@ def main():
import time
"""
assert isort.code(isort.code(isort.code(test_input))) == expected_output


def test_no_extra_blank_lines_in_methods_issue_1293():
"""Test to ensure isort isn't introducing extra lines in methods that contain imports
See: https://github.com/timothycrosley/isort/issues/1293
"""
test_input = """
class Something(object):
def on_email_deleted(self, email):
from hyperkitty.tasks import rebuild_thread_cache_new_email
# update or cleanup thread # noqa: E303 (isort issue)
if self.emails.count() == 0:
...
"""
assert isort.code(test_input) == test_input

0 comments on commit 1685beb

Please sign in to comment.