Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Jan 1, 2018
1 parent a8e6042 commit dadaf93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pyquickhelper/pycode/coverage_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def copy_replace(source, dest, root_source):
dests[ind] = destcov2
shutil.copy(destcov, destcov2)
cov = Coverage(data_file=destcov, source=[source])
with open(dests[0], "r") as f:
ex = f.read()
cov.combine(dests)
cov.html_report(directory=output_path)
outfile = os.path.join(output_path, "coverage_report.xml")
Expand All @@ -133,7 +135,7 @@ def copy_replace(source, dest, root_source):
"source='{0}'".format(source),
"dests='{0}'".format(';'.join(dests))]
raise RuntimeError(
"Converage report is empty in '{0}'.\n{1}\n{2}".format(output_path, "\n".join(rows), content))
"Converage report is empty in '{0}'.\n{1}\n{2}\n---\n{3}".format(output_path, "\n".join(rows), content, ex))
return cov


Expand Down

0 comments on commit dadaf93

Please sign in to comment.