use list comp for getreports in terminal py (#9243)

This commit is contained in:
Simon K 2021-11-06 16:32:37 +00:00 committed by GitHub
parent 49f934618c
commit 7037a58711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -892,11 +892,7 @@ class TerminalReporter:
# Summaries for sessionfinish. # Summaries for sessionfinish.
# #
def getreports(self, name: str): def getreports(self, name: str):
values = [] return [x for x in self.stats.get(name, ()) if not hasattr(x, "_pdbshown")]
for x in self.stats.get(name, []):
if not hasattr(x, "_pdbshown"):
values.append(x)
return values
def summary_warnings(self) -> None: def summary_warnings(self) -> None:
if self.hasopt("w"): if self.hasopt("w"):