Merge pull request #9970 from ezio-melotti/fix-tempdirfactory-docstring

Fix rst markup in TempdirFactory's docstring.
This commit is contained in:
Bruno Oliveira 2022-05-17 08:13:11 -03:00 committed by GitHub
commit 8469f44401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -101,7 +101,7 @@ repos:
types: [python] types: [python]
- id: py-path-deprecated - id: py-path-deprecated
name: py.path usage is deprecated name: py.path usage is deprecated
exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py exclude: docs|src/_pytest/deprecated.py|testing/deprecated_test.py|src/_pytest/legacypath.py
language: pygrep language: pygrep
entry: \bpy\.path\.local entry: \bpy\.path\.local
types: [python] types: [python]

View File

@ -270,8 +270,8 @@ class LegacyTestdirPlugin:
@final @final
@attr.s(init=False, auto_attribs=True) @attr.s(init=False, auto_attribs=True)
class TempdirFactory: class TempdirFactory:
"""Backward compatibility wrapper that implements :class:``_pytest.compat.LEGACY_PATH`` """Backward compatibility wrapper that implements :class:`py.path.local`
for :class:``TempPathFactory``.""" for :class:`TempPathFactory`."""
_tmppath_factory: TempPathFactory _tmppath_factory: TempPathFactory
@ -282,11 +282,11 @@ class TempdirFactory:
self._tmppath_factory = tmppath_factory self._tmppath_factory = tmppath_factory
def mktemp(self, basename: str, numbered: bool = True) -> LEGACY_PATH: def mktemp(self, basename: str, numbered: bool = True) -> LEGACY_PATH:
"""Same as :meth:`TempPathFactory.mktemp`, but returns a ``_pytest.compat.LEGACY_PATH`` object.""" """Same as :meth:`TempPathFactory.mktemp`, but returns a :class:`py.path.local` object."""
return legacy_path(self._tmppath_factory.mktemp(basename, numbered).resolve()) return legacy_path(self._tmppath_factory.mktemp(basename, numbered).resolve())
def getbasetemp(self) -> LEGACY_PATH: def getbasetemp(self) -> LEGACY_PATH:
"""Backward compat wrapper for ``_tmppath_factory.getbasetemp``.""" """Same as :meth:`TempPathFactory.getbasetemp`, but returns a :class:`py.path.local` object."""
return legacy_path(self._tmppath_factory.getbasetemp().resolve()) return legacy_path(self._tmppath_factory.getbasetemp().resolve())