-
Is there an easier way to get a session-scoped @pytest.fixture(scope="session")
def tmp_path(tmp_path_factory):
basetemp = tmp_path_factory.getbasetemp()
basetemp = basetemp.relative_to(basetemp.parents[0])
return tmp_path_factory.mktemp(basetemp) I'm not even sure it will use the same directory structure as the built-in EDIT: I'm now using this instead: @pytest.fixture(scope="session")
def tmp_path(tmp_path_factory):
return tmp_path_factory.mktemp("data") |
Beta Was this translation helpful? Give feedback.
Answered by
bluetech
Apr 27, 2021
Replies: 1 comment 1 reply
-
Yes, that's the way. I recommend using a different name than |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
pawamoy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, that's the way. I recommend using a different name than
tmp_path
however, since that is already used by the builtin function-scoped fixture.