-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingtestingRelated to testing Ruff itselfRelated to testing Ruff itselftyMulti-file analysis & type inferenceMulti-file analysis & type inference
Description
When testing #15026 I got spurious test failures that look like the different test cases within an mdtest file aren't as isolated as they should be:
At commit 65da139, the Relative - Dotted test fails when you test the entire file:
$ cargo test -p red_knot_python_semantic -- mdtest__import_relative
[snip]
relative.md - Relative - Dotted
crates/red_knot_python_semantic/resources/mdtest/import/relative.md:39 unexpected error: [unresolved-import] "Cannot resolve import `.foo.bar.baz`"
crates/red_knot_python_semantic/resources/mdtest/import/relative.md:41 unmatched assertion: revealed: Literal[42]
crates/red_knot_python_semantic/resources/mdtest/import/relative.md:41 unexpected error: 1 [revealed-type] "Revealed type is `Unknown`"
but pass when you run that test by itself:
$ env MDTEST_TEST_FILTER="relative.md - Relative - Dotted" cargo test -p red_knot_python_semantic -- mdtest__import_relative
Renaming the files in that one test case to be unique within the mdtest file (c5fd3c6) also causes test to pass for both invocations.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtestingRelated to testing Ruff itselfRelated to testing Ruff itselftyMulti-file analysis & type inferenceMulti-file analysis & type inference