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)
| 167 | |
| 168 | |
| 169 | def pytest_configure(config: Config) -> None: |
| 170 | """Create a TempPathFactory and attach it to the config object. |
| 171 | |
| 172 | This is to comply with existing plugins which expect the handler to be |
| 173 | available at pytest_configure time, but ideally should be moved entirely |
| 174 | to the tmp_path_factory session fixture. |
| 175 | """ |
| 176 | mp = MonkeyPatch() |
| 177 | config.add_cleanup(mp.undo) |
| 178 | _tmp_path_factory = TempPathFactory.from_config(config, _ispytest=True) |
| 179 | mp.setattr(config, "_tmp_path_factory", _tmp_path_factory, raising=False) |
| 180 | |
| 181 | |
| 182 | @fixture(scope="session") |
nothing calls this directly
no test coverage detected