tmp_path

>Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory.
>The returned object is a pathlib.Path object.

macOS mktemp -d
pytest-of-<>
TODOfail

Python tempfile使
Path(from_env or tempfile.gettempdir())
Pathmkdirtempfile