[v1.x] Pass a list to parametrize in test_docs_examples (pytest 9.1.0 compat)

Merged
MA
4mo ago
+1-1

pytest 9.1.0 deprecates passing a non-Collection iterable (e.g. a generator) to pytest.mark.parametrize, raising PytestRemovedIn10Warning. With filterwarnings = ["error"] this fails collection on the highest-resolution CI lanes (all lowest-direct lanes pass since they pin an older pytest).

pytest_examples.find_examples() returns a generator; materialize it as a list. This is the fix pytest's own message recommends ("Please convert to a list or tuple").

Test-infrastructure only; no change to shipped code. Unblocks the v1.28.0 publish run.

The same change will be needed on main.

AI Disclaimer