Skip to content

Commit

Permalink
terminal: _get_main_color: help pytest-parallel
Browse files Browse the repository at this point in the history
Use `dict.keys()` to work around `__iter__` not working with a
multiprocessing DictProxy.

Ref: python/cpython#17333
Fixes pytest-dev#6254.
Ref: kevlened/pytest-parallel#36
  • Loading branch information
blueyed authored and vinaycalastry committed Dec 11, 2019
1 parent 40ba953 commit 5453bbb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/6254.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix compatibility with pytest-parallel (regression in pytest 5.3.0).
2 changes: 1 addition & 1 deletion src/_pytest/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ def _get_main_color(stats) -> Tuple[str, List[str]]:
"failed passed skipped deselected xfailed xpassed warnings error".split()
)
unknown_type_seen = False
for found_type in stats:
for found_type in stats.keys():
if found_type not in known_types:
if found_type: # setup/teardown reports have an empty key, ignore them
known_types.append(found_type)
Expand Down

0 comments on commit 5453bbb

Please sign in to comment.