Skip to content

Comments

[ty] Add support for using the test command emitted when a mdtest fails#19794

Merged
carljm merged 1 commit intoastral-sh:mainfrom
MatthewMckee4:mdtest-hash-match
Aug 6, 2025
Merged

[ty] Add support for using the test command emitted when a mdtest fails#19794
carljm merged 1 commit intoastral-sh:mainfrom
MatthewMckee4:mdtest-hash-match

Conversation

@MatthewMckee4
Copy link
Contributor

Summary

When seeing a failed test like

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

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? :)

@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@AlexWaygood AlexWaygood added testing Related to testing Ruff itself ty Multi-file analysis & type inference labels Aug 6, 2025
@MatthewMckee4 MatthewMckee4 changed the title Add support for using the test command emitted when a mdtest fails [ty] Add support for using the test command emitted when a mdtest fails Aug 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Aug 6, 2025

mypy_primer results

No ecosystem changes detected ✅
No memory usage changes detected ✅

Copy link
Contributor

@carljm carljm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!

@carljm carljm merged commit 65b39f2 into astral-sh:main Aug 6, 2025
40 checks passed
dcreager added a commit that referenced this pull request Aug 7, 2025
* origin/main:
  [ty] Implemented support for "rename" language server feature (#19551)
  [ty] Reduce size of member table (#19572)
  [ty] Move server capabilities creation (#19798)
  [ty] Repurpose `FunctionType.into_bound_method_type` to return `BoundMethodType` (#19793)
  [ty] Validate writes to `TypedDict` keys (#19782)
  [ty] Add support for using the test command emitted when a mdtest fails (#19794)
@MatthewMckee4 MatthewMckee4 deleted the mdtest-hash-match branch November 6, 2025 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff itself ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants