Create a factory according to pytest configuration. :meta private:
(
cls,
config: Config,
*,
_ispytest: bool = False,
)
| 53 | |
| 54 | @classmethod |
| 55 | def from_config( |
| 56 | cls, |
| 57 | config: Config, |
| 58 | *, |
| 59 | _ispytest: bool = False, |
| 60 | ) -> "TempPathFactory": |
| 61 | """Create a factory according to pytest configuration. |
| 62 | |
| 63 | :meta private: |
| 64 | """ |
| 65 | check_ispytest(_ispytest) |
| 66 | return cls( |
| 67 | given_basetemp=config.option.basetemp, |
| 68 | trace=config.trace.get("tmpdir"), |
| 69 | _ispytest=True, |
| 70 | ) |
| 71 | |
| 72 | def _ensure_relative_to_basetemp(self, basename: str) -> str: |
| 73 | basename = os.path.normpath(basename) |
no test coverage detected