Skip to content

Commit

Permalink
Restore support for sphinx.testing.path paths in ``sphinx.testing…
Browse files Browse the repository at this point in the history
….fixtures`` (#13378)

Co-authored-by: Adam Turner <[email protected]>
  • Loading branch information
attakei and AA-Turner authored Feb 21, 2025
1 parent d099161 commit 7e1bf28
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Contributors
* Juan Luis Cano Rodríguez -- new tutorial (2021)
* Julien Palard -- Colspan and rowspan in text builder
* Justus Magin -- napoleon improvements
* Kazuya Take -- ``sphinx.testing.path`` bug fix
* Kevin Dunn -- MathJax extension
* KINEBUCHI Tomohiko -- typing Sphinx as well as docutils
* Kurt McKee -- documentation updates
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Features added
Bugs fixed
----------

* #13377: Restore support for using ``sphinx.testing.path`` paths with
``sphinx.testing.fixtures``.
Patch by Kazuya Takei.

Testing
-------

Expand Down
8 changes: 8 additions & 0 deletions sphinx/testing/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,26 @@ def isdir(self) -> bool:
"""Returns ``True`` if the path is a directory."""
return os.path.isdir(self)

is_dir = isdir

def isfile(self) -> bool:
"""Returns ``True`` if the path is a file."""
return os.path.isfile(self)

is_file = isfile

def islink(self) -> bool:
"""Returns ``True`` if the path is a symbolic link."""
return os.path.islink(self)

is_symlink = islink

def ismount(self) -> bool:
"""Returns ``True`` if the path is a mount point."""
return os.path.ismount(self)

is_mount = ismount

def rmtree(
self,
ignore_errors: bool = False,
Expand Down

0 comments on commit 7e1bf28

Please sign in to comment.