Skip to content

Use datatest for parser tests#21936

Merged
MichaReiser merged 3 commits intomicha/format-datatestfrom
micha/parser-datatest
Dec 12, 2025
Merged

Use datatest for parser tests#21936
MichaReiser merged 3 commits intomicha/format-datatestfrom
micha/parser-datatest

Conversation

@MichaReiser
Copy link
Copy Markdown
Member

Summary

Same as #21933 but for our parser tests.

datatest-stable uses a custom test-harness that mimics cargo test and supports cargo nextest to create a separate test for every file found in a given directory.
Unlike other test-macros, datatest-stable doesn't require re-compilation after adding or removing a test file (because it uses a custom test harness).

The main advantage of using it for the parser fixture tests is that each spec file now becomes its own test so that:

  • Tests can run in parallel, resulting in faster wall-time
  • You can run all tests even if there are a few failing tests
  • You can selectively run tests

@MichaReiser MichaReiser added the testing Related to testing Ruff itself label Dec 12, 2025
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Dec 12, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Dec 12, 2025

mypy_primer results

Changes were detected when running on open source projects
scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- src/scikit_build_core/build/wheel.py:98:20: error[no-matching-overload] No overload of bound method `__init__` matches arguments
- Found 42 diagnostics
+ Found 41 diagnostics

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ pandas-stubs/_typing.pyi:1218:16: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- Found 5136 diagnostics
+ Found 5137 diagnostics

No memory usage changes detected ✅

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Dec 12, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

Comment thread crates/ruff_python_parser/tests/fixtures.rs Outdated
@MichaReiser MichaReiser merged commit f94ac77 into micha/format-datatest Dec 12, 2025
41 checks passed
@MichaReiser MichaReiser deleted the micha/parser-datatest branch December 12, 2025 17:21
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants