Skip to content

MNT Avoid pytest warnings when pytest-run-parallel is not installed - #32088

Merged
lorentzenchr merged 1 commit into
scikit-learn:mainfrom
lesteve:avoid-pytest-warnings-when-pytest-parallel-not-installed
Sep 3, 2025
Merged

lorentzenchr merged 1 commit into
scikit-learn:mainfrom
lesteve:avoid-pytest-warnings-when-pytest-parallel-not-installed

Conversation

@lesteve

@lesteve lesteve commented Sep 3, 2025 •

Copy link
Copy Markdown
Member

Fix @lorentzenchr's workflow regression from #31342 (comment). Obligatory xkcd 😉.

Inspired from scipy conftest.py + tweak to add thread_unsafe_fixtures (I guess scipy does not use this option).

Tested locally with:

pytest -Werror sklearn/decomposition  

With the previous pytest command, on this PR the tests run 1. On main it fails at collection time with pytest INTERNALERROR.

Footnotes

  1. eventually the tests fail because there are plenty of warnings in the scikit-learn suite ↩

@github-actions

github-actions Bot commented Sep 3, 2025

Copy link
Copy Markdown

✔️ Linting Passed

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

Generated for commit: 3974d04. Link to the linter CI: here

@lorentzenchr lorentzenchr left a comment •

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.

@lesteve thanks for the workflow fix.

I hit me by surprise because nowhere in the dev doc is written what I need to install (pytest-run-parallel) to develop and run tests.

@lorentzenchr
lorentzenchr merged commit ad04078 into scikit-learn:main Sep 3, 2025
@lesteve

lesteve commented Sep 3, 2025 •

Copy link
Copy Markdown
Member Author

I hit me by surprise because nowhere in the dev doc is written what I need to install (pytest-run-parallel) to develop and run tests.

To be 100% clear, there was no expectation that you needed to install pytest-run-parallel to run the tests and you discovered a regression in a specific scenario that makes sense. With this PR it should be back to normal 🤞.

Free-threaded CI with pytest-run-parallel is very new (was merged yesterday I think). Depending on how it goes (how often the CI is broken in the next month or so) we may decide to document a bit how to run locally to reproduce CI errors, we will see ...

@jeremiedbb jeremiedbb mentioned this pull request Sep 3, 2025
13 tasks done
@lorentzenchr

Copy link
Copy Markdown
Member

@lesteve I am really grateful for the quick fix and it was a coincidance that I noticed the regression at all.
I prefer to move on and fix things as they appear instead of not moving!

@lesteve
lesteve deleted the avoid-pytest-warnings-when-pytest-parallel-not-installed branch September 4, 2025 07:02
DeaMariaLeon pushed a commit to DeaMariaLeon/scikit-learn that referenced this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants