diff --git a/src/pytest_cov/engine.py b/src/pytest_cov/engine.py index 93a0050e..322648b3 100644 --- a/src/pytest_cov/engine.py +++ b/src/pytest_cov/engine.py @@ -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 diff --git a/tests/test_pytest_cov.py b/tests/test_pytest_cov.py index adc28d54..e79e9aab 100644 --- a/tests/test_pytest_cov.py +++ b/tests/test_pytest_cov.py @@ -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)