Skip to content

Commit

Permalink
Merge pull request pytest-dev#7167 from bluetech/lint-merge-fix
Browse files Browse the repository at this point in the history
testing: fix lint after merge of old branch
  • Loading branch information
bluetech committed May 5, 2020
2 parents 4b91617 + 94400a6 commit 4787fd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/_pytest/terminal.py
Expand Up @@ -854,9 +854,12 @@ def collapsed_location_report(reports: List[WarningReport]):
if len(locations) < 10:
return "\n".join(map(str, locations))

counts_by_filename = collections.Counter(
str(loc).split("::", 1)[0] for loc in locations
)
counts_by_filename = (
collections.OrderedDict()
) # type: collections.OrderedDict[str, int]
for loc in locations:
key = str(loc).split("::", 1)[0]
counts_by_filename[key] = counts_by_filename.get(key, 0) + 1
return "\n".join(
"{}: {} warning{}".format(k, v, "s" if v > 1 else "")
for k, v in counts_by_filename.items()
Expand Down
2 changes: 1 addition & 1 deletion testing/test_config.py
Expand Up @@ -1465,7 +1465,7 @@ def test_pytest_plugins_in_non_top_level_conftest_unsupported_no_false_positives
warnings.filterwarnings('always', category=DeprecationWarning)
pytest_plugins=['capture']
""",
}
},
)
res = testdir.runpytest_subprocess()
assert res.ret == 0
Expand Down

0 comments on commit 4787fd6

Please sign in to comment.