Skip to content

Commit 0ce9d4a

Browse files
chore: Fix path to HTML coverage report during local tox run (#797)
* Fix path to HTML coverage report during local `tox` run * Do not show how to serve coverage report if there is no coverage --------- Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
1 parent dfbde65 commit 0ce9d4a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ commands_post =
9191
cov_html_reports or sys.exit(); \
9292
cov_html_report_dir = pathlib.Path(cov_html_reports[-1]); \
9393
index_file = cov_html_report_dir / "index.html";\
94+
index_file.exists() or sys.exit(); \
9495
html_url = f"file://\{index_file\}";\
9596
browse_cmd = shlex.join(("python3", "-Im", "webbrowser", html_url)); \
9697
serve_cmd = shlex.join((\
9798
"python3", "-Im", "http.server", \
98-
"--directory", "cov_html_report_dir", "0", \
99+
"--directory", str(cov_html_report_dir), "0", \
99100
)); \
100101
print(f"\nTo open the HTML coverage report, run\n\n\
101102
\t\{browse_cmd !s\}\n");\

0 commit comments

Comments
 (0)