Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/unit/test_isort.py
Original file line number Diff line number Diff line change
Expand Up @@ -5562,6 +5562,21 @@ def seekable(self):
assert identified_imports == [":1 import m2", ":2 import m1"]


def test_unindented_comments_issue_1899():
"""Ensure unindented comments in indented blocks are handled correctly"""

test_input = """
import sys

if True:
# this comment will get cut off
import os

"""

assert isort.code(test_input) == test_input


def test_split_on_trailing_comma() -> None:
test_input = "from lib import (a, b, c,)"
expected_output = """from lib import (
Expand Down
Loading