-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortype: refactoringinternal improvements to the codeinternal improvements to the code
Description
Consider the following code defining counts, and the similar counts_by_filename below:
pytest/src/_pytest/terminal.py
Lines 757 to 760 in 95917f8
| counts: Dict[str, int] = {} | |
| for item in items: | |
| name = item.nodeid.split("::", 1)[0] | |
| counts[name] = counts.get(name, 0) + 1 |
This is a classic case for collections.Counter, and would make a great first pull request!
Example solution initialising the Counter from an iterable:
counts = Counter(... for item in items) # you fill in the ... partReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueeasy issue that is friendly to new contributoreasy issue that is friendly to new contributortype: refactoringinternal improvements to the codeinternal improvements to the code