Skip to content

Commit 44a043b

Browse files
committed
revert unrelated snapshot tests
1 parent ea4a248 commit 44a043b

File tree

74 files changed

+4362
-5565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+4362
-5565
lines changed

crates/ruff_python_parser/resources/inline/ok/match_classify_as_keyword_1.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
case _: ...
1919
match not foo:
2020
case _: ...
21+
match await foo():
22+
case _: ...
2123
match lambda foo: foo:
2224
case _: ...
23-
def outer():
24-
match await foo():
25-
case _: ...

crates/ruff_python_parser/resources/inline/ok/match_stmt_subject_expr.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
# Starred expressions are only allowed in tuple expression
66
match *x | y, z:
77
case _: ...
8-
def outer():
9-
match await x:
10-
case _: ...
8+
match await x:
9+
case _: ...

crates/ruff_python_parser/resources/inline/ok/match_stmt_valid_guard_expr.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
case y if a if True else b: ...
55
match x:
66
case y if lambda a: b: ...
7-
def _():
8-
match x:
9-
case y if (yield x): ...
7+
match x:
8+
case y if (yield x): ...

crates/ruff_python_parser/resources/valid/expressions/arguments.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@
2222

2323
# Keyword expression
2424
call(x=1 if True else 2)
25-
def _(): call(x=await y)
25+
call(x=await y)
2626
call(x=lambda y: y)
2727
call(x=(y := 1))
2828

2929
# Yield expression
30-
def _():
31-
call((yield x))
32-
call((yield from x))
30+
call((yield x))
31+
call((yield from x))
3332

3433
# Named expression
3534
call(x := 1)
@@ -38,14 +37,14 @@ def _():
3837
# Starred expressions
3938
call(*x and y)
4039
call(*x | y)
41-
def _(): call(*await x)
40+
call(*await x)
4241
call(*lambda x: x)
4342
call(*x if True else y)
4443

4544
# Double starred
4645
call(**x)
4746
call(**x and y)
48-
def _(): call(**await x)
47+
call(**await x)
4948
call(**x if True else y)
50-
def _(): call(**(yield x))
49+
call(**(yield x))
5150
call(**lambda x: x)
Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
def outer():
2-
await x
3-
await x + 1
4-
await a and b
5-
await f()
6-
await [1, 2]
7-
await {3, 4}
8-
await {i: 5}
9-
await 7, 8
10-
await (9, 10)
11-
await 1 == 1
12-
await x if True else None
13-
await (*x,)
14-
await (lambda x: x)
15-
await x ** -x
16-
await x ** await y
1+
await x
2+
await x + 1
3+
await a and b
4+
await f()
5+
await [1, 2]
6+
await {3, 4}
7+
await {i: 5}
8+
await 7, 8
9+
await (9, 10)
10+
await 1 == 1
11+
await x if True else None
12+
await (*x,)
13+
await (lambda x: x)
14+
await x ** -x
15+
await x ** await y

crates/ruff_python_parser/resources/valid/expressions/bool_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
a and b or c
66
a and b and c or d or e and f or g
77
a and not b or c
8-
def outer(): yield a and b or c
8+
yield a and b or c
99
not a and b or c

crates/ruff_python_parser/resources/valid/expressions/call.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
(x for x in iter)()
1111
{1, 2, 3}()
1212
{1: 2, 3: 4}()
13-
def outer(): (yield x)()
13+
(yield x)()
1414

1515
# These are `TypeError`, so make sure it parses correctly.
1616
True()

crates/ruff_python_parser/resources/valid/expressions/compare.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
not x not in y
2424

2525
x or y not in z and a
26-
def outer():
27-
x == await y
28-
x is not await y
26+
x == await y
27+
x is not await y
2928

3029
# All operators have the same precedence
3130
a < b == c > d is e not in f is not g <= h >= i != j

crates/ruff_python_parser/resources/valid/expressions/dictionary_comprehension.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88

99
# Non-parenthesized iter/if for the following expressions aren't allowed, so make sure
1010
# it parses correctly for the parenthesized cases
11-
def outer():
12-
{x: y for x in (yield y)}
13-
{x: y for x in (yield from y)}
11+
{x: y for x in (yield y)}
12+
{x: y for x in (yield from y)}
1413
{x: y for x in (lambda y: y)}
15-
def outer():
16-
{x: y for x in data if (yield y)}
17-
{x: y for x in data if (yield from y)}
14+
{x: y for x in data if (yield y)}
15+
{x: y for x in data if (yield from y)}
1816
{x: y for x in data if (lambda y: y)}

crates/ruff_python_parser/resources/valid/expressions/if.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
x if True else lambda y: y
1212

1313
# These test expression are only allowed when parenthesized
14-
def _():
15-
x if (yield x) else y
16-
x if (yield from x) else y
14+
x if (yield x) else y
15+
x if (yield from x) else y
1716
x if (lambda x: x) else y
1817

1918
# Split across multiple lines
2019
(x
2120
if y
22-
else z)
21+
else z)

0 commit comments

Comments
 (0)