[ty] Disable panicking mdtest (#21016)

## Summary

Only run the "pull types" test after performing the "actual" mdtest. We
observed that the order matters. There is currently one mdtest which
panics when checked in the CLI or the playground. With this change, it
also panics in the mdtest suite.

reopens https://github.com/astral-sh/ty/issues/837?
This commit is contained in:
David Peter 2025-10-21 14:40:23 +02:00 committed by GitHub
parent 69ce064569
commit e1cada1ec3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 26 additions and 24 deletions

View File

@ -2551,11 +2551,13 @@ reveal_type(Answer.__members__) # revealed: MappingProxyType[str, Unknown]
## Divergent inferred implicit instance attribute types
```py
class C:
def f(self, other: "C"):
self.x = (other.x, 1)
# TODO: This test currently panics, see https://github.com/astral-sh/ty/issues/837
reveal_type(C().x) # revealed: Unknown | tuple[Divergent, Literal[1]]
# class C:
# def f(self, other: "C"):
# self.x = (other.x, 1)
#
# reveal_type(C().x) # revealed: Unknown | tuple[Divergent, Literal[1]]
```
## Attributes of standard library modules that aren't yet defined

View File

@ -323,26 +323,6 @@ fn run_test(
let mut failures: Failures = test_files
.iter()
.filter_map(|test_file| {
let pull_types_result = attempt_test(
db,
pull_types,
test_file,
"\"pull types\"",
Some(
"Note: either fix the panic or add the `<!-- pull-types:skip -->` \
directive to this test",
),
);
match pull_types_result {
Ok(()) => {}
Err(failures) => {
any_pull_types_failures = true;
if !test.should_skip_pulling_types() {
return Some(failures);
}
}
}
let parsed = parsed_module(db, test_file.file).load(db);
let mut diagnostics: Vec<Diagnostic> = parsed
@ -387,6 +367,26 @@ fn run_test(
}));
}
let pull_types_result = attempt_test(
db,
pull_types,
test_file,
"\"pull types\"",
Some(
"Note: either fix the panic or add the `<!-- pull-types:skip -->` \
directive to this test",
),
);
match pull_types_result {
Ok(()) => {}
Err(failures) => {
any_pull_types_failures = true;
if !test.should_skip_pulling_types() {
return Some(failures);
}
}
}
failure
})
.collect();