Skip to content

Commit

Permalink
Allow ipytest cell magic (#13745)
Browse files Browse the repository at this point in the history
## Summary

fixes: #13718 

## Test Plan

Using the notebook as mentioned in
#13718 (comment),
this PR does not give the "F821 Undefined name `test_sorted`"
diagnostic.
  • Loading branch information
dhruvmanila authored Oct 14, 2024
1 parent 814ab47 commit 5caabe5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/ruff_notebook/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,19 @@ impl Cell {
//
// This is to avoid false positives when these variables are referenced
// elsewhere in the notebook.
//
// Refer https://github.com/astral-sh/ruff/issues/13718 for `ipytest`.
!matches!(
command,
"capture" | "debug" | "prun" | "pypy" | "python" | "python3" | "time" | "timeit"
"capture"
| "debug"
| "ipytest"
| "prun"
| "pypy"
| "python"
| "python3"
| "time"
| "timeit"
)
})
}
Expand Down

0 comments on commit 5caabe5

Please sign in to comment.