From 885d9f2f8584e9fe3666295cdcf6bffb668b0c25 Mon Sep 17 00:00:00 2001 From: Max Isbey <224885523+maxisbey@users.noreply.github.com> Date: Tue, 16 Jun 2026 21:23:56 +0000 Subject: [PATCH] [v1.x] Pass a list to parametrize in test_docs_examples 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. find_examples() returns a generator; materialize it as a list. --- tests/test_examples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_examples.py b/tests/test_examples.py index 6f5464e394..51a5c52dbf 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -100,7 +100,7 @@ async def test_desktop(monkeypatch: pytest.MonkeyPatch): assert "/fake/path/file2.txt" in content.text -@pytest.mark.parametrize("example", find_examples("README.md"), ids=str) +@pytest.mark.parametrize("example", list(find_examples("README.md")), ids=str) def test_docs_examples(example: CodeExample, eval_example: EvalExample): ruff_ignore: list[str] = ["F841", "I001", "F821"] # F821: undefined names (snippets lack imports)