MCPcopy Create free account
hub / github.com/pytest-dev/pytest / from_config

Method from_config

src/_pytest/tmpdir.py:55–70  ·  view source on GitHub ↗

Create a factory according to pytest configuration. :meta private:

(
        cls,
        config: Config,
        *,
        _ispytest: bool = False,
    )

Source from the content-addressed store, hash-verified

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)

Callers 1

pytest_configureFunction · 0.45

Calls 3

check_ispytestFunction · 0.90
clsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected