Description
from the tmp_path how-to docs:
Temporary directories are by default created as sub-directories of the system temporary directory. ... entries older than 3 temporary directories will be removed. ... can be configured with
tmp_path_retention_count
...Using the
--basetemp
option will remove the directory before every run, effectively meaning the temporary directories
of only the most recent run will be kept.
Is there any particular reason that the retention feature (keep 3 by default) is not supported when --basetemp
is used?
It seems like these features should be orthogonal, but that's not the case which is counter-intuitive.
Current workaround is apparently to use the PYTEST_DEBUG_TEMPROOT
env var instead of --basetemp
but that feature is not documented as far as I could find.
I understand that there are concerns about backward compatibility, but I think basetemp+retention can be implented in a backward compatible way:
- use
--basetemp
, but notmp_path_retention_count
config set: use custom temp root without retention (existing behavior) - use
--basetemp
andtmp_path_retention_count
: use custom temp root with retention (this feature request)