@@ -73,7 +73,7 @@ commands_post =
7373 {[python-cli-options]max-isolation} \
7474 {[python-cli-options]warnings-to-errors} \
7575 -c\
76- ' import pathlib, sys; \
76+ ' import pathlib, shlex, sys; \
7777 cov_html_report_arg_prefix = "--cov-report=html:"; \
7878 cov_html_reports = [\
7979 arg[len(cov_html_report_arg_prefix):] for arg in sys.argv \
@@ -83,13 +83,16 @@ commands_post =
8383 cov_html_report_dir = pathlib.Path(cov_html_reports[-1]); \
8484 index_file = cov_html_report_dir / "index.html";\
8585 html_url = f"file://\{ index_file\} ";\
86+ browse_cmd = shlex.join(("python3", "-Im", "webbrowser", html_url)); \
87+ serve_cmd = shlex.join((\
88+ "python3", "-Im", "http.server", \
89+ "--directory", "cov_html_report_dir", "0", \
90+ )); \
8691 print(f"\n To open the HTML coverage report, run\n\n \
87- \t python3 -Im webbrowser \
88- \N\{ QUOTATION MARK\}\{ html_url !s\}\N\{ QUOTATION MARK\}\n ");\
92+ \t\{ browse_cmd !s\}\n ");\
8993 print(f"To serve \
9094 the HTML coverage report with a local web server, use\n\n \
91- \t python3 -Im http.server --directory \
92- \N\{ QUOTATION MARK\}\{ cov_html_report_dir\}\N\{ QUOTATION MARK\} 0\n ")' \
95+ \t\{ serve_cmd !s\}\n ")' \
9396 {posargs:--cov-report =html:{envtmpdir}{/}htmlcov{/}}
9497package = editable
9598pass_env =
0 commit comments