We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 60b73ec commit 218419fCopy full SHA for 218419f
src/pytest_cov/plugin.py
@@ -326,7 +326,11 @@ def pytest_terminal_summary(self, terminalreporter):
326
# we shouldn't report, or report generation failed (error raised above)
327
return
328
329
- terminalreporter.write('\n' + self.cov_report.getvalue() + '\n')
+ report = self.cov_report.getvalue()
330
+
331
+ # Avoid undesirable new lines when output is disabled with "--cov-report=".
332
+ if report:
333
+ terminalreporter.write('\n' + report + '\n')
334
335
if self.options.cov_fail_under is not None and self.options.cov_fail_under > 0:
336
failed = self.cov_total < self.options.cov_fail_under
0 commit comments