Skip to content

Commit

Permalink
perf: only call summary when the report will be used
Browse files Browse the repository at this point in the history
  • Loading branch information
jstewmon committed Mar 27, 2023
1 parent 2ea9442 commit 74eb4cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pytest_cov/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ def pytest_testnodedown(self, node, error):
self.cov_controller.testnodedown(node, error)

def _should_report(self):
return not (self.failed and self.options.no_cov_on_fail)
needed = self.options.cov_report or self.options.cov_fail_under
return needed and not (self.failed and self.options.no_cov_on_fail)

def _failed_cov_total(self):
cov_fail_under = self.options.cov_fail_under
Expand Down

0 comments on commit 74eb4cc

Please sign in to comment.