Create a TempPathFactory and attach it to the config object. This is to comply with existing plugins which expect the handler to be available at pytest_configure time, but ideally should be moved entirely to the tmp_path_factory session fixture.
(config: Config)
| 242 | |
| 243 | |
| 244 | def pytest_configure(config: Config) -> None: |
| 245 | """Create a TempPathFactory and attach it to the config object. |
| 246 | |
| 247 | This is to comply with existing plugins which expect the handler to be |
| 248 | available at pytest_configure time, but ideally should be moved entirely |
| 249 | to the tmp_path_factory session fixture. |
| 250 | """ |
| 251 | mp = MonkeyPatch() |
| 252 | config.add_cleanup(mp.undo) |
| 253 | _tmp_path_factory = TempPathFactory.from_config(config, _ispytest=True) |
| 254 | mp.setattr(config, "_tmp_path_factory", _tmp_path_factory, raising=False) |
| 255 | |
| 256 | |
| 257 | def pytest_addoption(parser: Parser) -> None: |
nothing calls this directly
no test coverage detected