Backward compatibility wrapper that implements :class:``_pytest.compat.LEGACY_PATH`` for :class:``TempPathFactory``.
| 270 | @final |
| 271 | @attr.s(init=False, auto_attribs=True) |
| 272 | class TempdirFactory: |
| 273 | """Backward compatibility wrapper that implements :class:``_pytest.compat.LEGACY_PATH`` |
| 274 | for :class:``TempPathFactory``.""" |
| 275 | |
| 276 | _tmppath_factory: TempPathFactory |
| 277 | |
| 278 | def __init__( |
| 279 | self, tmppath_factory: TempPathFactory, *, _ispytest: bool = False |
| 280 | ) -> None: |
| 281 | check_ispytest(_ispytest) |
| 282 | self._tmppath_factory = tmppath_factory |
| 283 | |
| 284 | def mktemp(self, basename: str, numbered: bool = True) -> LEGACY_PATH: |
| 285 | """Same as :meth:`TempPathFactory.mktemp`, but returns a ``_pytest.compat.LEGACY_PATH`` object.""" |
| 286 | return legacy_path(self._tmppath_factory.mktemp(basename, numbered).resolve()) |
| 287 | |
| 288 | def getbasetemp(self) -> LEGACY_PATH: |
| 289 | """Backward compat wrapper for ``_tmppath_factory.getbasetemp``.""" |
| 290 | return legacy_path(self._tmppath_factory.getbasetemp().resolve()) |
| 291 | |
| 292 | |
| 293 | class LegacyTmpdirPlugin: |