-
Notifications
You must be signed in to change notification settings - Fork 225
Closed
Description
Back in version 2.2.1 we were more tolerant when something went wrong with coverage report generation:
if not (self.failed and self.options.no_cov_on_fail):
try:
total = self.cov_controller.summary(terminalreporter.writer)
except CoverageException as exc:
terminalreporter.writer.write('Failed to generate report: %s\n' % exc)
total = 0
With 2.5.1, we raise exception instead:
if not self._is_slave(session) and self._should_report():
try:
self.cov_total = self.cov_controller.summary(self.cov_report)
except CoverageException as exc:
raise pytest.UsageError(
'Failed to generate report: %s\n' % exc
)
assert self.cov_total is not None, 'Test coverage should never be `None`'
Do you think it would make sense if we make it to be tolerant like the old days? I'm having some projects that are built on multiple Python implementations with the same code base. One of the implementation (Jython) doesn't support code coverage and will cause CoverageException. If we re-raise the exception here, the whole test will fail.
I can send a PR for this, but I would like to get some opinions first.
Metadata
Metadata
Assignees
Labels
No labels