Skip to content

Commit

Permalink
Add regression test for issue #1264 demonstrating failure
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Jul 6, 2020
1 parent a3a7251 commit 686d3c7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_regressions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""A growing set of tests designed to ensure isort doesn't have regressions in new versions"""
import isort


def test_isort_duplicating_comments_issue_1264():
"""Ensure isort doesn't duplicate comments when force_sort_within_sections is set to `True`
as was the case in issue #1264: https://github.com/timothycrosley/isort/issues/1264
"""
assert isort.code("""
from homeassistant.util.logging import catch_log_exception
# Loading the config flow file will register...
from . import config_flow
""", force_sort_within_sections=True).count("# Loading the config flow file will register...") == 1

0 comments on commit 686d3c7

Please sign in to comment.