Skip to content

Commit

Permalink
Add failing test case for generator inside call
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Oct 15, 2024
1 parent 65566db commit 5b0537c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rewrite/tests/python/all/comprehension_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from rewrite.test import rewrite_run, python


Expand Down Expand Up @@ -84,3 +86,9 @@ def test_generator_with_if():
def test_generator_with_multiple_ifs():
# language=python
rewrite_run(python("a = {e:None for e in range(10) if e > 1 if e < 10}"))


@pytest.mark.xfail(reason="These optional parentheses are really difficult to parse correctly", strict=True)
def test_generator_without_parens_inside_call():
# language=python
rewrite_run(python("a = sum((2 - 1) * k for k in [1])"))

0 comments on commit 5b0537c

Please sign in to comment.