-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify whether and when tmp_path
is deleted after each use
#8036
Comments
Pytest keeps around the last 3 test runs, we ought to make that more discoverable |
Hi, I'm interested in helping here. Where would be best to note this so that it's more discoverable? It looks to be already noted here: https://github.com/pytest-dev/pytest/blob/master/doc/en/tmpdir.rst#the-default-base-temporary-directory, could this be moved to somewhere more visible? |
We might add a note to |
Thanks. When you say "the last 3 test runs," do you mean the last 3 test sessions, or the last 3 individual tests? |
@xuhdev the last 3 sessions, when creating a new basetemp, pytest tries to keep the last 3 around to aid debugging |
Explanation: The default handling in `tmpdir.TempPathFactory.getbasetemp` handles these lifetimes, passing `keep=3` to `pathlib.make_numbered_dir_with_cleanup`. GH Issue: pytest-dev#8036
Explanation: The default handling in `tmpdir.TempPathFactory.getbasetemp` handles these lifetimes, passing `keep=3` to `pathlib.make_numbered_dir_with_cleanup`. GH Issue: pytest-dev#8036
Explanation: The default handling in `tmpdir.TempPathFactory.getbasetemp` handles these lifetimes, passing `keep=3` to `pathlib.make_numbered_dir_with_cleanup`. GH Issue: pytest-dev#8036
Explanation: The default handling of these lifetimes is done in `tmpdir.TempPathFactory.getbasetemp`, which passes `keep=3` to `pathlib.make_numbered_dir_with_cleanup`. GH Issue: pytest-dev#8036
Explanation: The default handling of these lifetimes is done in `tmpdir.TempPathFactory.getbasetemp`, which passes `keep=3` to `pathlib.make_numbered_dir_with_cleanup`. GH Issue: pytest-dev#8036
Would it be acceptable to add a flag where the tempfiles are delete if the test is successful? for large datasets that get created for tests, it is advantageous for us to be able to use a standard fixture, without worrying about running out of diskspace. |
Hi @hmaarrfk, I think a configuration option would be acceptable, something like |
An option to generally keep only failed tests could be a big space safer |
Ahh indeed, I misinterpreted @hmaarrfk's request. I agree keeping only the tmp directory of failed tests would make for a better option. |
If this feature (or another from this thread) is desired, I'd be interested in working on it. |
its a desired feature, lets open a issue to clarify the details and then it can be started |
Agreed, created: #8141 |
Closing this as fixed by #8038 |
Currently the document is unclear about whether and when
tmp_path
is deleted after each use. After I digged into the code, I still have no idea. I wish there could be some clarification on this topic in the document.The text was updated successfully, but these errors were encountered: