Skip to content

Python tests: replace iterator argvalues before pytest 10 - #92

Open
olivhoenen wants to merge 1 commit into
developfrom
split85/B-pytest10
Open

olivhoenen wants to merge 1 commit into
developfrom
split85/B-pytest10

Conversation

@olivhoenen

Copy link
Copy Markdown
Collaborator

Part of the split of #85 (Tests and Benchmarks for regression) into smaller, single-purpose PRs that are easier to review.

pytest 10 rejects non-Collection iterables as parametrize argvalues: test_exception.py now materializes its itertools.product into a list, and pyproject.toml turns PytestRemovedIn10Warning into an error so similar usage fails early.

Fork history: yohannmarguier#48

Stack position: independent, based on develop.

Authorship: these commits are @yohannmarguier's, cherry-picked unchanged from his fork with git cherry-pick -x, so each one keeps its original author, date and message plus a (cherry picked from commit …) link back to the fork. Only conflicts with current develop and with the new commit order were resolved.

⚠️ Please merge with "Create a merge commit" or "Rebase and merge", not "Squash and merge": squashing would attribute Yohann's commits to the person who merges.

🤖 Generated with Claude Code

itertools.product returns a one-shot iterator; passing it directly as
parametrize argvalues is deprecated (PytestRemovedIn10Warning) and
becomes a collection error in pytest 10. Materialize it with list().

Make PytestRemovedIn10Warning an error in [tool.pytest.ini_options]
filterwarnings so every pytest run (local and CI) fails on
removed-in-10 usage before an unbounded pytest upgrade does.

Verified: python -m pytest python/tests -W
error::pytest.PytestRemovedIn10Warning passes (15 passed, 5 skipped),
all six test_ALException cases still collect, and the old iterator
pattern now fails collection under the new filter.

Closes #48

(cherry picked from commit 7274728)

This branch has not been deployed

No deployments
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