Skip to content

Add option to use strict xfail mode in parametrize_with_checks #31951

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

betatim
Copy link
Member

@betatim betatim commented Aug 15, 2025

Reference Issues/PRs

Fixes #31931

What does this implement/fix? Explain your changes.

This adds an option to parametrize_with_checks (and the functions it uses) that allow you to specify "strict mode" for xfailed tests. In strict mode unexpectedly passing tests lead to a test failure. This helps keep the xfail list up to date.

You can configure this globally via pytest.ini for the whole test suite or for individual tests via the xfail marker.

Any other comments?

In cuml we have a lot of common checks that fail and hence are marked as xfail. As we go through fixing things it would be good to have strict mode enabled to help keep the xfail list up to date. We don't really want to turn on strict mode for the whole test suite though (this would be a bigger discussion).

I am not super happy with the testing of this testing infrastructure. For example I only noticed that passing strict=None to the mark overrides the config from pytest.init by trying it out for real, I couldn't figure out a test that would catch it (except the explicit one I added). Ideas welcome, also comments that say "this looks super good enough" :D

In strict mode unexpectedly passing tests lead to a test failure. This
helps keep the xfail list up to date.
Copy link

github-actions bot commented Aug 15, 2025

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 53d24b8. Link to the linter CI: here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow common estimator checks to use xfail_strict=True
1 participant