From c09ca4dd598f72799400c9849d7aa50b5ef1eb09 Mon Sep 17 00:00:00 2001 From: Victor Lin Date: Mon, 15 Jun 2026 12:35:41 -0700 Subject: [PATCH] Fix pytest warnings Pytest 9.1.0 added a warning on non-Collection iterables used for parameterization (treated as an error per pytest.ini). https://github.com/pytest-dev/pytest/releases/tag/9.1.0 --- tests/cram.py | 2 +- tests/markdown.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/cram.py b/tests/cram.py index e19aaf22..2a55f1c2 100644 --- a/tests/cram.py +++ b/tests/cram.py @@ -7,7 +7,7 @@ topdir = testsdir.parent @pytest.mark.skipif(os.name != "posix", reason = "cram requires a POSIX platform") -@pytest.mark.parametrize("testfile", testsdir.glob("*.cram"), ids = str) +@pytest.mark.parametrize("testfile", list(testsdir.glob("*.cram")), ids = str) def pytest_cram(testfile): # Check the exit status ourselves for nicer test output on failure result = run(["cram", testfile], cwd = topdir) diff --git a/tests/markdown.py b/tests/markdown.py index cb6659e4..98e35a3f 100644 --- a/tests/markdown.py +++ b/tests/markdown.py @@ -8,10 +8,12 @@ datadir = testsdir / "data/markdown/" def cases(pattern): - for case in datadir.glob(pattern): - yield pytest.param( + return [ + pytest.param( case, id = str(case.relative_to(topdir))) + for case in datadir.glob(pattern) + ] @pytest.mark.parametrize("case", cases("roundtrip-*.md"))