Skip to content

Commit

Permalink
Fix regression described in #348 - not all reports returning the total.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Oct 5, 2019
1 parent 5df26bd commit 5ef4767
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pytest_cov/engine.py
Expand Up @@ -155,14 +155,14 @@ def summary(self, stream):
if 'html' in self.cov_report:
output = self.cov_report['html']
with _backup(self.cov, "config"):
self.cov.html_report(ignore_errors=True, directory=output)
total = self.cov.html_report(ignore_errors=True, directory=output)
stream.write('Coverage HTML written to dir %s\n' % (self.cov.config.html_dir if output is None else output))

# Produce xml report if wanted.
if 'xml' in self.cov_report:
output = self.cov_report['xml']
with _backup(self.cov, "config"):
self.cov.xml_report(ignore_errors=True, outfile=output)
total = self.cov.xml_report(ignore_errors=True, outfile=output)
stream.write('Coverage XML written to file %s\n' % (self.cov.config.xml_output if output is None else output))

return total
Expand Down
3 changes: 2 additions & 1 deletion tests/test_pytest_cov.py
Expand Up @@ -396,7 +396,8 @@ def test_cov_min_50(testdir):

result = testdir.runpytest('-v',
'--cov=%s' % script.dirpath(),
'--cov-report=term-missing',
'--cov-report=html',
'--cov-report=xml',
'--cov-fail-under=50',
script)

Expand Down

0 comments on commit 5ef4767

Please sign in to comment.