Skip to content

Commit a1ed683

Browse files
committed
Refer to py.path.local instead of LEGACY_PATH constant for better docs
1 parent 296b642 commit a1ed683

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ repos:
101101
types: [python]
102102
- id: py-path-deprecated
103103
name: py.path usage is deprecated
104-
exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py
104+
exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py|src/_pytest/legacypath.py
105105
language: pygrep
106106
entry: \bpy\.path\.local
107107
types: [python]

src/_pytest/legacypath.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def testdir(pytester: Pytester) -> Testdir:
270270
@final
271271
@attr.s(init=False, auto_attribs=True)
272272
class TempdirFactory:
273-
"""Backward compatibility wrapper that implements :class:`_pytest.compat.LEGACY_PATH`
273+
"""Backward compatibility wrapper that implements :class:`py.path.local`
274274
for :class:`TempPathFactory`."""
275275

276276
_tmppath_factory: TempPathFactory
@@ -282,11 +282,11 @@ def __init__(
282282
self._tmppath_factory = tmppath_factory
283283

284284
def mktemp(self, basename: str, numbered: bool = True) -> LEGACY_PATH:
285-
"""Same as :meth:`TempPathFactory.mktemp`, but returns a ``_pytest.compat.LEGACY_PATH`` object."""
285+
"""Same as :meth:`TempPathFactory.mktemp`, but returns a :class:`py.path.local` object."""
286286
return legacy_path(self._tmppath_factory.mktemp(basename, numbered).resolve())
287287

288288
def getbasetemp(self) -> LEGACY_PATH:
289-
"""Backward compat wrapper for ``_tmppath_factory.getbasetemp``."""
289+
"""Same as :meth:`TempPathFactory.getbasetemp`, but returns a :class:`py.path.local` object."""
290290
return legacy_path(self._tmppath_factory.getbasetemp().resolve())
291291

292292

0 commit comments

Comments
 (0)