Skip to content

Commit

Permalink
Add test case for issue #1645: Allowing sort order to be reversed
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycrosley committed Mar 17, 2021
1 parent 0805019 commit 7802b4f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/unit/test_ticketed_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,3 +1029,33 @@ def test_isort_auto_detects_and_ignores_invalid_from_imports_issue_1688():
from package3 import also_ok
"""
)


def test_isort_allows_reversing_sort_order_issue_1645():
"""isort allows reversing the sort order for those who prefer Z or longer imports first.
see: https://github.com/PyCQA/isort/issues/1688
"""
assert (
isort.code(
"""
from xxx import (
g,
hi,
def,
abcd,
)
""",
profile="black",
reverse_sort=True,
length_sort=True,
line_length=20,
)
== """
from xxx import (
abcd,
def,
hi,
g,
)
"""
)

0 comments on commit 7802b4f

Please sign in to comment.