Skip to content

Commit 885d9f2

Browse files
committed
[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.
1 parent 0dca751 commit 885d9f2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tests/test_examples.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async def test_desktop(monkeypatch: pytest.MonkeyPatch):
100100
assert "/fake/path/file2.txt" in content.text
101101

102102

103-
@pytest.mark.parametrize("example", find_examples("README.md"), ids=str)
103+
@pytest.mark.parametrize("example", list(find_examples("README.md")), ids=str)
104104
def test_docs_examples(example: CodeExample, eval_example: EvalExample):
105105
ruff_ignore: list[str] = ["F841", "I001", "F821"] # F821: undefined names (snippets lack imports)
106106

0 commit comments

Comments
 (0)