Skip to content

Commit

Permalink
finish up nedbat#1819
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jul 19, 2024
1 parent ecf9ccf commit 0ae0869
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ upgrading your version of coverage.py.
Unreleased
----------

Nothing yet.
- Fix: coverage used to fail when measuring code using :func:`runpy.run_path
<python:runpy.run_path>` with a :class:`Path <python:pathlib.Path>` argument.
This is now fixed, thanks to `Ask Hjorth Larsen <pull 1819_>`_.

.. _pull 1819: https://github.com/nedbat/coveragepy/pull/1819/files


.. scriv-start-here
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Artem Dayneko
Arthur Deygin
Arthur Rio
Asher Foa
Ask Hjorth Larsen
Ben Carlsson
Ben Finney
Benjamin Parzella
Expand Down
6 changes: 3 additions & 3 deletions tests/test_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def test_source_for_file_windows(tmp_path: pathlib.Path) -> None:
assert source_for_file(src + 'c') == src


class RunpyPathTest(CoverageTest):
run_in_temp_dir = True
class RunpyTest(CoverageTest):
"""Tests using runpy."""

def test_runpy_path(self):
def test_runpy_path(self) -> None:
"""Ensure runpy.run_path(path) works when path is pathlib.Path.
runpy.run_path(pathlib.Path(...)) causes __file__ to be a Path,
Expand Down

0 comments on commit 0ae0869

Please sign in to comment.