diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2023-04-26 18:36:02 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2023-04-26 22:01:13 -0400 |
commit | 40cc55c0dc18d999cd4d3c1b278d6e120f858ab5 (patch) | |
tree | 96842492fe72b9ddf3923e9efe72985e16244dd4 | |
parent | 5f31ff9ae35cee27a25f4413664c0ac527fc3a15 (diff) | |
download | python-coveragepy-git-40cc55c0dc18d999cd4d3c1b278d6e120f858ab5.tar.gz |
fix: no need for terminal url except for html report
-rw-r--r-- | CHANGES.rst | 7 | ||||
-rw-r--r-- | CONTRIBUTORS.txt | 1 | ||||
-rw-r--r-- | coverage/report.py | 8 |
3 files changed, 9 insertions, 7 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index ec31b21b..5f89576f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -20,11 +20,18 @@ development at the same time, such as 4.5.x and 5.0. Unreleased ---------- +- When the HTML report location is printed to the terminal, it's now a + terminal-compatible URL, so that you can click the location to open the HTML + file in your browser. Finishes `issue 1523`_ thanks to `Ricardo Newbery + <pull 1613_>`_. + - Docs: a new :ref:`Migrating page <migrating>` with details about how to migrate between major versions of coverage.py. It currently covers the wildcard changes in 7.x. Thanks, `Brian Grohe <pull 1610_>`_. +.. _issue 1523: https://github.com/nedbat/coveragepy/issues/1523 .. _pull 1610: https://github.com/nedbat/coveragepy/pull/1610 +.. _pull 1613: https://github.com/nedbat/coveragepy/pull/1613 .. scriv-start-here diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index f5f2898f..b02f7add 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -147,6 +147,7 @@ Peter Ebden Peter Portante Phebe Polk Reya B +Ricardo Newbery Rodrigue Cloutier Roger Hu Ross Lawley diff --git a/coverage/report.py b/coverage/report.py index 1e14eb78..09eed0a8 100644 --- a/coverage/report.py +++ b/coverage/report.py @@ -5,7 +5,6 @@ from __future__ import annotations -import os import sys from typing import Callable, Iterable, Iterator, IO, Optional, Tuple, TYPE_CHECKING @@ -59,12 +58,7 @@ def render_report( try: ret = reporter.report(morfs, outfile=outfile) if file_to_close is not None: - if sys.stdout.isatty(): - file_path = f"file://{os.path.abspath(output_path)}" - print_path = f"\033]8;;{file_path}\a{output_path}\033]8;;\a" - else: - print_path = output_path - msgfn(f"Wrote {reporter.report_type} to {print_path}") + msgfn(f"Wrote {reporter.report_type} to {output_path}") delete_file = False return ret finally: |