Skip to content

Commit 40cc55c

Browse files
committedApr 27, 2023
fix: no need for terminal url except for html report
1 parent 5f31ff9 commit 40cc55c

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed
 

‎CHANGES.rst

+7
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,18 @@ development at the same time, such as 4.5.x and 5.0.
2020
Unreleased
2121
----------
2222

23+
- When the HTML report location is printed to the terminal, it's now a
24+
terminal-compatible URL, so that you can click the location to open the HTML
25+
file in your browser. Finishes `issue 1523`_ thanks to `Ricardo Newbery
26+
<pull 1613_>`_.
27+
2328
- Docs: a new :ref:`Migrating page <migrating>` with details about how to
2429
migrate between major versions of coverage.py. It currently covers the
2530
wildcard changes in 7.x. Thanks, `Brian Grohe <pull 1610_>`_.
2631

32+
.. _issue 1523: https://github.com/nedbat/coveragepy/issues/1523
2733
.. _pull 1610: https://github.com/nedbat/coveragepy/pull/1610
34+
.. _pull 1613: https://github.com/nedbat/coveragepy/pull/1613
2835

2936
.. scriv-start-here
3037

‎CONTRIBUTORS.txt

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ Peter Ebden
147147
Peter Portante
148148
Phebe Polk
149149
Reya B
150+
Ricardo Newbery
150151
Rodrigue Cloutier
151152
Roger Hu
152153
Ross Lawley

‎coverage/report.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from __future__ import annotations
77

8-
import os
98
import sys
109

1110
from typing import Callable, Iterable, Iterator, IO, Optional, Tuple, TYPE_CHECKING
@@ -59,12 +58,7 @@ def render_report(
5958
try:
6059
ret = reporter.report(morfs, outfile=outfile)
6160
if file_to_close is not None:
62-
if sys.stdout.isatty():
63-
file_path = f"file://{os.path.abspath(output_path)}"
64-
print_path = f"\033]8;;{file_path}\a{output_path}\033]8;;\a"
65-
else:
66-
print_path = output_path
67-
msgfn(f"Wrote {reporter.report_type} to {print_path}")
61+
msgfn(f"Wrote {reporter.report_type} to {output_path}")
6862
delete_file = False
6963
return ret
7064
finally:

0 commit comments

Comments
 (0)
Please sign in to comment.