Fix warnings summary header appearing twice

Ref: https://github.com/pytest-dev/pytest/pull/4450#discussion_r236017645
Ref: https://github.com/pytest-dev/pytest/pull/4399
This commit is contained in:
Daniel Hahler
2018-11-23 22:39:05 +01:00
parent 16b15af624
commit be3b8fc9c1
4 changed files with 30 additions and 7 deletions
+2
View File
@@ -734,6 +734,8 @@ class TerminalReporter(object):
else:
warnings = all_warnings
self._already_displayed_warnings = len(warnings)
if not warnings:
return
grouped = itertools.groupby(
warnings, key=lambda wr: wr.get_location(self.config)