Skip to content

Add mdtests for Ruff#24617

Draft
ntBre wants to merge 10 commits intobrent/mdtest-runfrom
brent/ruff-mdtests
Draft

Add mdtests for Ruff#24617
ntBre wants to merge 10 commits intobrent/mdtest-runfrom
brent/ruff-mdtests

Conversation

@ntBre
Copy link
Copy Markdown
Contributor

@ntBre ntBre commented Apr 13, 2026

Summary

This PR adds the ruff_test crate, a parallel crate to ty_test for Ruff, to
enable the new mdtests in ruff_linter. I opted to follow the Db-based
structure of ty_test to simplify the integration, but we end up basically just
unpacking the files from the Db to call the test_contents function from the
linter.

Currently stacked on #24616

Test Plan

I copied over UP046_0.py into a new mdtest. This was selected basically at
random, and I should probably either pick a shorter first test to port, or also
port over the other UP046 tests and take better advantage of the mdtest format.
Currently the whole file is just in a single code block, but it demonstrates the
basic functionality, including config loading and diagnostic snapshotting.

@ntBre ntBre added the testing Related to testing Ruff itself label Apr 13, 2026
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 13, 2026

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 87.94%. The percentage of expected errors that received a diagnostic held steady at 83.36%. The number of fully passing files held steady at 79/133.

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 13, 2026

Memory usage report

Memory usage unchanged ✅

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 13, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
possibly-missing-attribute 0 0 81
possibly-missing-submodule 0 11 0
unresolved-attribute 11 0 0
invalid-argument-type 0 10 0
invalid-assignment 0 1 0
Total 11 22 81
Raw diff (114 changes)
pandera (https://github.com/pandera-dev/pandera)
- tests/dask/test_dask.py:111:27 warning[possibly-missing-submodule] Submodule `dask` might not have been imported
+ tests/dask/test_dask.py:111:27 error[unresolved-attribute] Attribute `dask` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/dask/test_dask.py:114:28 warning[possibly-missing-submodule] Submodule `dask` might not have been imported
+ tests/dask/test_dask.py:114:28 error[unresolved-attribute] Attribute `dask` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/fastapi/models.py:10:9 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:10:9 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/fastapi/models.py:11:11 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:11:11 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/fastapi/models.py:23:9 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:23:9 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/fastapi/models.py:24:11 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:24:11 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/fastapi/models.py:25:11 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:25:11 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/fastapi/models.py:48:9 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/fastapi/models.py:48:9 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/modin/test_schemas_on_modin.py:323:20 warning[possibly-missing-submodule] Submodule `modin` might not have been imported
+ tests/modin/test_schemas_on_modin.py:323:20 error[unresolved-attribute] Attribute `modin` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/modin/test_schemas_on_modin.py:324:22 warning[possibly-missing-submodule] Submodule `modin` might not have been imported
+ tests/modin/test_schemas_on_modin.py:324:22 error[unresolved-attribute] Attribute `modin` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/modin/test_schemas_on_modin.py:325:20 warning[possibly-missing-submodule] Submodule `modin` might not have been imported
+ tests/modin/test_schemas_on_modin.py:325:20 error[unresolved-attribute] Attribute `modin` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/modin/test_schemas_on_modin.py:394:12 warning[possibly-missing-submodule] Submodule `modin` might not have been imported
+ tests/modin/test_schemas_on_modin.py:394:12 error[unresolved-attribute] Attribute `modin` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/modin/test_schemas_on_modin.py:397:12 warning[possibly-missing-submodule] Submodule `modin` might not have been imported
+ tests/modin/test_schemas_on_modin.py:397:12 error[unresolved-attribute] Attribute `modin` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/modin/test_schemas_on_modin.py:423:13 warning[possibly-missing-submodule] Submodule `modin` might not have been imported
+ tests/modin/test_schemas_on_modin.py:423:13 error[unresolved-attribute] Attribute `modin` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/modin/test_schemas_on_modin.py:424:10 warning[possibly-missing-submodule] Submodule `modin` might not have been imported
+ tests/modin/test_schemas_on_modin.py:424:10 error[unresolved-attribute] Attribute `modin` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/modin/test_schemas_on_modin.py:430:13 warning[possibly-missing-submodule] Submodule `modin` might not have been imported
+ tests/modin/test_schemas_on_modin.py:430:13 error[unresolved-attribute] Attribute `modin` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/modin/test_schemas_on_modin.py:431:10 warning[possibly-missing-submodule] Submodule `modin` might not have been imported
+ tests/modin/test_schemas_on_modin.py:431:10 error[unresolved-attribute] Attribute `modin` is not defined on `<module 'pandera.typing'>` in union `Divergent | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:8:8 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:8:8 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:9:8 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:9:8 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:10:8 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:10:8 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:14:8 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:14:8 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:15:8 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:15:8 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_inheritance.py:16:8 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_inheritance.py:16:8 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/mypy/pandas_modules/pandera_types.py:14:4 error[invalid-argument-type] Argument to function `fn` is incorrect: Expected `pandera.typing.pandas.Series[int]`, found `pandas.core.series.Series[Any]`
- tests/mypy/pandas_modules/pandera_types.py:15:4 error[invalid-argument-type] Argument to function `fn` is incorrect: Expected `pandera.typing.pandas.Series[int]`, found `pandas.core.series.Series[Any]`
- tests/mypy/pandas_modules/pandera_types.py:7:16 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/mypy/pandas_modules/pandera_types.py:7:16 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_extensions.py:258:15 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_extensions.py:258:15 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_extensions.py:259:15 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_extensions.py:259:15 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_extensions.py:293:18 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_extensions.py:293:18 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_extensions.py:303:14 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_extensions.py:303:14 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:313:16 error[invalid-argument-type] Argument to function `fn` is incorrect: Expected `pandera.typing.pandas.DataFrame[InSchema]`, found `pandas.core.frame.DataFrame`
- tests/pandas/test_from_to_format_conversions.py:317:18 error[invalid-argument-type] Argument to function `fn` is incorrect: Expected `pandera.typing.pandas.DataFrame[InSchema]`, found `pandas.core.frame.DataFrame`
- tests/pandas/test_from_to_format_conversions.py:330:20 error[invalid-argument-type] Argument to function `invalid_fn` is incorrect: Expected `pandera.typing.pandas.DataFrame[InSchema]`, found `pandas.core.frame.DataFrame`
- tests/pandas/test_from_to_format_conversions.py:17:14 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:17:14 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:18:14 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:18:14 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:74:16 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:74:16 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:221:16 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:221:16 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:300:16 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:300:16 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:300:50 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:300:50 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:305:13 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:305:13 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_from_to_format_conversions.py:306:10 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_from_to_format_conversions.py:306:10 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:241:23 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:241:23 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2103:15 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2103:15 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2104:15 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2104:15 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2122:15 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2122:15 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2123:15 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2123:15 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2141:15 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2141:15 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2142:15 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2142:15 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2165:15 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2165:15 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2166:15 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2166:15 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2268:20 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2268:20 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2270:13 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_model.py:2270:13 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_model.py:2270:58 error[invalid-assignment] Object of type `pandas.core.frame.DataFrame` is not assignable to `pandera.typing.pandas.DataFrame[PanderaDataFrameModel]`
- tests/pandas/test_multithreaded.py:11:11 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_multithreaded.py:11:11 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_parsers.py:174:16 warning[possibly-missing-attribute] Member `Index` may be missing on module `pandera.typing`
+ tests/pandas/test_parsers.py:174:16 warning[possibly-missing-attribute] Attribute `Index` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_pydantic_dtype.py:60:22 error[invalid-argument-type] Argument to function `func` is incorrect: Expected `pandera.typing.pandas.DataFrame[PydanticSchema]`, found `pandas.core.frame.DataFrame`
- tests/pandas/test_pydantic_dtype.py:68:14 error[invalid-argument-type] Argument to function `func` is incorrect: Expected `pandera.typing.pandas.DataFrame[PydanticSchema]`, found `pandas.core.frame.DataFrame`
- tests/pandas/test_pydantic_dtype.py:32:11 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_pydantic_dtype.py:32:11 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_pydantic_dtype.py:33:13 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_pydantic_dtype.py:33:13 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_pydantic_dtype.py:34:13 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/pandas/test_pydantic_dtype.py:34:13 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_pydantic_dtype.py:41:18 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_pydantic_dtype.py:41:18 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:25:10 error[invalid-argument-type] Argument to function `func` is incorrect: Expected `pandera.typing.pandas.DataFrame[Model]`, found `pandas.core.frame.DataFrame`
- tests/pandas/test_schema_forwardref.py:27:14 error[invalid-argument-type] Argument to function `func` is incorrect: Expected `pandera.typing.pandas.DataFrame[Model]`, found `pandas.core.frame.DataFrame`
- tests/pandas/test_schema_forwardref.py:46:20 error[invalid-argument-type] Argument to function `local_func` is incorrect: Expected `pandera.typing.pandas.DataFrame[LocalModel]`, found `pandas.core.frame.DataFrame`
- tests/pandas/test_schema_forwardref.py:16:16 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:16:16 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:16:47 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:16:47 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:38:15 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:38:15 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:39:10 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:39:10 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:108:23 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:108:23 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:109:16 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:109:16 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_schema_forwardref.py:114:16 warning[possibly-missing-attribute] Member `DataFrame` may be missing on module `pandera.typing`
+ tests/pandas/test_schema_forwardref.py:114:16 warning[possibly-missing-attribute] Attribute `DataFrame` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:22:17 warning[possibly-missing-attribute] Member `Bool` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:22:17 warning[possibly-missing-attribute] Attribute `Bool` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:26:17 warning[possibly-missing-attribute] Member `DateTime` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:26:17 warning[possibly-missing-attribute] Attribute `DateTime` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:30:17 warning[possibly-missing-attribute] Member `Category` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:30:17 warning[possibly-missing-attribute] Attribute `Category` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:34:17 warning[possibly-missing-attribute] Member `Float` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:34:17 warning[possibly-missing-attribute] Attribute `Float` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:38:17 warning[possibly-missing-attribute] Member `Float16` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:38:17 warning[possibly-missing-attribute] Attribute `Float16` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:42:17 warning[possibly-missing-attribute] Member `Float32` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:42:17 warning[possibly-missing-attribute] Attribute `Float32` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:46:17 warning[possibly-missing-attribute] Member `Float64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:46:17 warning[possibly-missing-attribute] Attribute `Float64` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:50:17 warning[possibly-missing-attribute] Member `Int` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:50:17 warning[possibly-missing-attribute] Attribute `Int` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:54:17 warning[possibly-missing-attribute] Member `Int8` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:54:17 warning[possibly-missing-attribute] Attribute `Int8` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:58:17 warning[possibly-missing-attribute] Member `UInt8` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:58:17 warning[possibly-missing-attribute] Attribute `UInt8` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:62:17 warning[possibly-missing-attribute] Member `Int16` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:62:17 warning[possibly-missing-attribute] Attribute `Int16` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:66:17 warning[possibly-missing-attribute] Member `UInt16` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:66:17 warning[possibly-missing-attribute] Attribute `UInt16` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:70:17 warning[possibly-missing-attribute] Member `Int32` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:70:17 warning[possibly-missing-attribute] Attribute `Int32` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:74:17 warning[possibly-missing-attribute] Member `UInt32` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:74:17 warning[possibly-missing-attribute] Attribute `UInt32` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:78:17 warning[possibly-missing-attribute] Member `Int64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:78:17 warning[possibly-missing-attribute] Attribute `Int64` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:82:17 warning[possibly-missing-attribute] Member `UInt64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:82:17 warning[possibly-missing-attribute] Attribute `UInt64` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:86:17 warning[possibly-missing-attribute] Member `Object` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:86:17 warning[possibly-missing-attribute] Attribute `Object` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:90:17 warning[possibly-missing-attribute] Member `String` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:90:17 warning[possibly-missing-attribute] Attribute `String` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:94:17 warning[possibly-missing-attribute] Member `Timedelta` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:94:17 warning[possibly-missing-attribute] Attribute `Timedelta` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:98:17 warning[possibly-missing-attribute] Member `INT8` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:98:17 warning[possibly-missing-attribute] Attribute `INT8` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:102:17 warning[possibly-missing-attribute] Member `UINT8` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:102:17 warning[possibly-missing-attribute] Attribute `UINT8` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:106:17 warning[possibly-missing-attribute] Member `INT16` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:106:17 warning[possibly-missing-attribute] Attribute `INT16` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:110:17 warning[possibly-missing-attribute] Member `UINT16` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:110:17 warning[possibly-missing-attribute] Attribute `UINT16` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:114:17 warning[possibly-missing-attribute] Member `INT32` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:114:17 warning[possibly-missing-attribute] Attribute `INT32` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:118:17 warning[possibly-missing-attribute] Member `UINT32` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:118:17 warning[possibly-missing-attribute] Attribute `UINT32` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:122:17 warning[possibly-missing-attribute] Member `INT64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:122:17 warning[possibly-missing-attribute] Attribute `INT64` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:126:17 warning[possibly-missing-attribute] Member `UINT64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:126:17 warning[possibly-missing-attribute] Attribute `UINT64` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:498:17 warning[possibly-missing-attribute] Member `Bool` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:498:17 warning[possibly-missing-attribute] Attribute `Bool` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/pandas/test_typing.py:512:17 warning[possibly-missing-attribute] Member `Int64` may be missing on module `pandera.typing`
+ tests/pandas/test_typing.py:512:17 warning[possibly-missing-attribute] Attribute `Int64` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/strategies/test_strategies.py:979:11 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/strategies/test_strategies.py:979:11 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/strategies/test_strategies.py:980:11 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/strategies/test_strategies.py:980:11 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`
- tests/strategies/test_strategies.py:981:11 warning[possibly-missing-attribute] Member `Series` may be missing on module `pandera.typing`
+ tests/strategies/test_strategies.py:981:11 warning[possibly-missing-attribute] Attribute `Series` may be missing on object of type `Divergent | <module 'pandera.typing'>`

Full report with detailed diff (timing results)

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot Bot commented Apr 13, 2026

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_linter/tests/mdtest.rs Outdated
use anyhow::anyhow;
use camino::Utf8Path;
use ruff_test::OutputFormat;
use ty_static::EnvVars;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I saw https://github.com/astral-sh/ruff/pull/24557/changes#r3069608578 about not using this even in ty_test, which I think makes even more sense here.

Comment thread crates/ruff_linter/tests/mdtest.rs Outdated
Comment on lines +23 to +28
let output_format = if std::env::var(EnvVars::MDTEST_GITHUB_ANNOTATIONS_FORMAT).is_ok() {
OutputFormat::GitHub
} else {
OutputFormat::Cli
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could also consider moving this into ty_test::run? Seems weird that this needs to be reated at every call site.

@ntBre ntBre force-pushed the brent/ruff-mdtests branch 2 times, most recently from 39890d5 to 7f6a3ca Compare April 15, 2026 13:07
ntBre added a commit that referenced this pull request Apr 16, 2026
Summary
--

This is a first step toward adding mdtests for Ruff. I actually wrote
the code
in the opposite order, first copy-pasting `ty_test` to a `ruff_test`
crate, and then
factoring out the shared code, but I figured it would be easier to
review in
this order. I also opened a stacked PR with the `ruff_test` changes
(#24617)
to show that the API works well for that too.

The main change here is moving several of the modules from `ty_test` to
a new
`mdtest` crate:
- `assertion`
- `diagnostic`
- `matcher`
- `parser`

Beyond moving these files to the new crate, I made `Matcher` functions
take a
`&dyn Db` to support passing a different concrete type from `ruff_test`,
and I
also made the parser generic over an `MdtestConfig` trait to allow Ruff
to use a
separate config struct. I also introduced new `TestConfig` and `TestDb`
types to allow
testing the `matcher` and `parser` within the `mdtest` crate without
depending
on either the real ty `Db` or `ty_test` config type.

The lib.rs file from `ty_test` was essentially split in half, with the
shared
code moved to the `mdtest` crate and the ty-specific parts kept in
`ty_test`.

Test Plan
--

All existing mdtests and the unit tests from `ty_test` should still
pass, and
the stacked branch with the `ruff_test` crate tests the split API
Base automatically changed from brent/mdtest-crate to main April 16, 2026 14:32
@ntBre ntBre force-pushed the brent/ruff-mdtests branch 3 times, most recently from 57c1643 to 83f7f97 Compare April 20, 2026 17:11
@ntBre ntBre changed the base branch from main to brent/mdtest-run April 21, 2026 14:24
@ntBre ntBre force-pushed the brent/ruff-mdtests branch from 83f7f97 to 41d0d57 Compare April 21, 2026 14:25
@ntBre ntBre force-pushed the brent/ruff-mdtests branch from 41d0d57 to 0ad4abe Compare April 21, 2026 14:28
@ntBre ntBre force-pushed the brent/mdtest-run branch from 9287424 to e3fb85f Compare April 22, 2026 15:10
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