-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
test_ok
for inline tests, merge test report (#10801)
## Summary This PR makes two quality of life improvements for parser's inline test implementation: 1. Rename `test` to `test_ok` to explicitly specify that this is a valid syntax test 2. Merge the reporting of "ok" and "err" test cases and unreferenced test cases The output of (2) now looks like: ``` ---- generate_inline_tests stdout ---- Error: Unreferenced test files found for which no comment exists: crates/ruff_python_parser/resources/inline/err/something_else.py Please delete these files manually Following files were not up-to date and has been updated: crates/ruff_python_parser/resources/inline/err/renamed_it.py Re-run the tests with `cargo test` to update the test snapshots ``` ## Test Plan 1. Add two random test cases: ```rs // test_ok something // x = 1 // test_err something_else // [1, 2 ``` 2. Run the generation step: ```console cargo test --package ruff_python_parser --test generate_inline_tests ``` 3. Rename `something_else` to `renamed_it` and run the generation step again to see the above output
- Loading branch information
1 parent
9b623a0
commit d8cd78c
Showing
6 changed files
with
95 additions
and
49 deletions.
There are no files selected for viewing
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
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
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