Skip to content

Commit 1f736a6

Browse files
committed
terminal: _get_main_color: help pytest-parallel
Use `dict.keys()` to work around `__iter__` not working with a multiprocessing DictProxy. Ref: python/cpython#17333 Fixes #6254. Ref: kevlened/pytest-parallel#36
1 parent 63c9ad0 commit 1f736a6

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

changelog/6254.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix compatibility with pytest-parallel (regression in pytest 5.3.0).

src/_pytest/terminal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ def _get_main_color(stats) -> Tuple[str, List[str]]:
10991099
"failed passed skipped deselected xfailed xpassed warnings error".split()
11001100
)
11011101
unknown_type_seen = False
1102-
for found_type in stats:
1102+
for found_type in stats.keys():
11031103
if found_type not in known_types:
11041104
if found_type: # setup/teardown reports have an empty key, ignore them
11051105
known_types.append(found_type)

0 commit comments

Comments
 (0)