Skip to content

Commit 5ef4767

Browse files
committed
Fix regression described in #348 - not all reports returning the total.
1 parent 5df26bd commit 5ef4767

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/pytest_cov/engine.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ def summary(self, stream):
155155
if 'html' in self.cov_report:
156156
output = self.cov_report['html']
157157
with _backup(self.cov, "config"):
158-
self.cov.html_report(ignore_errors=True, directory=output)
158+
total = self.cov.html_report(ignore_errors=True, directory=output)
159159
stream.write('Coverage HTML written to dir %s\n' % (self.cov.config.html_dir if output is None else output))
160160

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

168168
return total

tests/test_pytest_cov.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,8 @@ def test_cov_min_50(testdir):
396396

397397
result = testdir.runpytest('-v',
398398
'--cov=%s' % script.dirpath(),
399-
'--cov-report=term-missing',
399+
'--cov-report=html',
400+
'--cov-report=xml',
400401
'--cov-fail-under=50',
401402
script)
402403

0 commit comments

Comments
 (0)