Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Merge branch 'main' into trailing_comma
  • Loading branch information
timothycrosley authored May 11, 2022
commit 798ea224eeee2e740882920822c74a0aa9e25458
18 changes: 18 additions & 0 deletions tests/unit/test_isort.py
Original file line number Diff line number Diff line change
Expand Up @@ -5578,3 +5578,21 @@ def test_split_on_trailing_comma() -> None:

output = isort.code(expected_output, split_on_trailing_comma=True)
assert output == expected_output


def test_infinite_loop_in_unmatched_parenthesis() -> None:
test_input = "from os import ("

# ensure a syntax error is raised for unmatched parenthesis
with pytest.raises(ExistingSyntaxErrors):
isort.code(test_input)

test_input = """from os import (
path,

walk
)
"""

# ensure other cases are handled correctly
assert isort.code(test_input) == "from os import path, walk\n"
You are viewing a condensed version of this merge commit. You can view the full changes here.