-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move remaining tests to new framework (#10856)
## Summary This PR moves the remaining tests to the resources directory. The reason this was remaining is because it's all mainly with item tests which I was working on at that moment. I've removed duplicate test cases and moved only the unique ones.
- Loading branch information
1 parent
75304d2
commit 5ed7d0e
Showing
17 changed files
with
2,480 additions
and
3,598 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
crates/ruff_python_parser/resources/inline/err/ann_assign_stmt_type_alias_annotation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
a: type X = int | ||
lambda: type X = int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
crates/ruff_python_parser/resources/invalid/statements/with/unparenthesized_with_items.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# For parenthesized with items test cases, refer to `./ambiguous_lpar_with_items.py` | ||
|
||
with item,: pass | ||
with item as x,: pass | ||
with *item: pass | ||
with *item as x: pass | ||
with *item1, item2 as f: pass | ||
with item1 as f, *item2: pass | ||
with item := 0 as f: pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 14 additions & 2 deletions
16
crates/ruff_python_parser/resources/valid/statement/with.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,14 @@ | ||
with 1 as x: | ||
pass | ||
# This file only contains unparenthesized with items. Refer to ./ambiguous_lpar_with_items.py | ||
# for parenthesized with items test cases | ||
|
||
with item: ... | ||
with item as f: ... | ||
with item1, item2: ... | ||
with item1 as f1, item2 as f2: ... | ||
|
||
with x if True else y: ... | ||
with x if True else y as f: ... | ||
|
||
# Postfix expressions | ||
with open() as f: ... | ||
with open() as f.attr: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
mod parser; | ||
mod suite; | ||
|
||
use crate::{lex, parse, parse_suite, parse_tokens, Mode}; | ||
|
||
#[test] | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.