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.
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 tmpdir and tmp_path in the reference docs.
Pytest keeps around the last 3 test runs, we ought to make that more discoverable
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
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 tmp_keep, which by default is 3 but could be set to 0 to accomplish what you mention. 馃憤
An option to generally keep only failed tests could be a big space safer
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.
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: https://github.com/pytest-dev/pytest/issues/8141
Closing this as fixed by #8038