mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:21 +00:00
[ty] Add support for using the test command emitted when a mdtest fails (#19794)
## Summary When seeing a failed test like ```bash is_subtype_of.md - Subtype relation - Callable - Class literals - Classes with `__new_… (1e9782853227c019) crates/ty_python_semantic/resources/mdtest/type_properties/is_subtype_of.md:1810 unexpected error: [unresolved-reference] "Name `Aa` used when not defined" To rerun this specific test, set the environment variable: MDTEST_TEST_FILTER='is_subtype_of.md - Subtype relation - Callable - Class literals - Classes with `__new_… (1e9782853227c019)' MDTEST_TEST_FILTER='is_subtype_of.md - Subtype relation - Callable - Class literals - Classes with `__new_… (1e9782853227c019)' cargo test -p ty_python_semantic --test mdtest -- mdtest__type_properties_is_subtype_of ``` running the following now works ```bash MDTEST_TEST_FILTER='is_subtype_of.md - Subtype relation - Callable - Class literals - Classes with `__new_… (1e9782853227c019)' cargo test -p ty_python_semantic --test mdtest -- mdtest__type_properties_is_subtype_of ``` ## Test Plan Do we have tests for the test runner? :)
This commit is contained in:
parent
585ce12ace
commit
65b39f2ca9
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ pub fn run(
|
|||
for test in suite.tests() {
|
||||
if filter
|
||||
.as_ref()
|
||||
.is_some_and(|f| !test.uncontracted_name().contains(f))
|
||||
.is_some_and(|f| !(test.uncontracted_name().contains(f) || test.name() == *f))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue