-
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.
Add test for Notebook text output (#7925)
## Summary This PR adds test cases for the Notebook output in text format. ## Test Plan Update test snapshots.
- Loading branch information
1 parent
cd564c4
commit f08a5f6
Showing
5 changed files
with
177 additions
and
2 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
32 changes: 32 additions & 0 deletions
32
...ruff_linter/src/message/snapshots/ruff_linter__message__text__tests__notebook_output.snap
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,32 @@ | ||
--- | ||
source: crates/ruff_linter/src/message/text.rs | ||
expression: content | ||
--- | ||
notebook.ipynb:cell 1:2:8: F401 [*] `os` imported but unused | ||
| | ||
1 | # cell 1 | ||
2 | import os | ||
| ^^ F401 | ||
| | ||
= help: Remove unused import: `os` | ||
|
||
notebook.ipynb:cell 2:2:8: F401 [*] `math` imported but unused | ||
| | ||
1 | # cell 2 | ||
2 | import math | ||
| ^^^^ F401 | ||
3 | | ||
4 | print('hello world') | ||
| | ||
= help: Remove unused import: `math` | ||
|
||
notebook.ipynb:cell 3:4:5: F841 [*] Local variable `x` is assigned to but never used | ||
| | ||
2 | def foo(): | ||
3 | print() | ||
4 | x = 1 | ||
| ^ F841 | ||
| | ||
= help: Remove assignment to unused variable `x` | ||
|
||
|
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