Skip to content

Commit 82d8292

Browse files
committed
Fix test suite when running under pytest 8
It now produces an extra CollectReport for the extra pytest.Directory being collected.
1 parent 4873dd8 commit 82d8292

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/test_reportlog.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ def test_warning():
6161
result.stdout.fnmatch_lines([f"* generated report log file: {log_file}*"])
6262

6363
json_objs = [json.loads(x) for x in log_file.read_text().splitlines()]
64-
assert len(json_objs) == 14
64+
if pytest.version_tuple[0] < 8:
65+
assert len(json_objs) == 14
66+
else:
67+
# In pytest 8 it produces an extra CollectReport for the extra pytest.Directory being collected.
68+
assert len(json_objs) == 15
6569

6670
# first line should be the session_start
6771
session_start = json_objs[0]

0 commit comments

Comments
 (0)