Skip to content

Commit c09ca4d

Browse files
committed
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
1 parent ff7cd17 commit c09ca4d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

tests/cram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
topdir = testsdir.parent
88

99
@pytest.mark.skipif(os.name != "posix", reason = "cram requires a POSIX platform")
10-
@pytest.mark.parametrize("testfile", testsdir.glob("*.cram"), ids = str)
10+
@pytest.mark.parametrize("testfile", list(testsdir.glob("*.cram")), ids = str)
1111
def pytest_cram(testfile):
1212
# Check the exit status ourselves for nicer test output on failure
1313
result = run(["cram", testfile], cwd = topdir)

tests/markdown.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
datadir = testsdir / "data/markdown/"
99

1010
def cases(pattern):
11-
for case in datadir.glob(pattern):
12-
yield pytest.param(
11+
return [
12+
pytest.param(
1313
case,
1414
id = str(case.relative_to(topdir)))
15+
for case in datadir.glob(pattern)
16+
]
1517

1618

1719
@pytest.mark.parametrize("case", cases("roundtrip-*.md"))

0 commit comments

Comments
 (0)