Skip to content

Commit

Permalink
* add try-except for coverage report part
Browse files Browse the repository at this point in the history
  • Loading branch information
HYLcool committed Mar 4, 2025
1 parent 1de809b commit 5dbfc77
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,20 @@ def main():
res = runner.run(test_suite)

cov.stop()
cov.save()

if not res.wasSuccessful():
exit(1)

cov.report(ignore_errors=True)
cov.html_report(directory=f'coverage_report_{args.tag}', ignore_errors=True)
try:
cov.report(ignore_errors=True)
except Exception as e:
logger.error(f'Failed to print coverage report: {e}')

try:
cov.html_report(directory=f'coverage_report_{args.tag}', ignore_errors=True)
except Exception as e:
logger.error(f'Failed to generate coverage report in html: {e}')


if __name__ == '__main__':
Expand Down

0 comments on commit 5dbfc77

Please sign in to comment.