Skip to content
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

Allow changing the number temporary directories pytest keeps which is currently 3 #9599

Closed
szabgab opened this issue Feb 3, 2022 · 3 comments
Labels
type: question general question, might be closed after 2 weeks of inactivity

Comments

@szabgab
Copy link
Contributor

szabgab commented Feb 3, 2022

Currently pytest will keep the last 3 root temporary directories for each testing session, for all tests.

As far as I can tell it is a hard-coded parameter here:


that cannot be changed using a configuration option.

In my current situation a single run creates 12Gb of data and it is growing as we add more tests. It would be nice if there was a way to change this number. I'd sacrifice the debug-ability to save disk-space. At least till we can find other ways to reduce the disk usage. Others might want to keep more history.

This is related to #8141 as well.

@szabgab szabgab changed the title Allow changing the number temporary directories pytests keeps which is currently 3 Allow changing the number temporary directories pytest keeps which is currently 3 Feb 3, 2022
@RonnyPfannschmidt
Copy link
Member

the basetmp option
is a ideal way to enforce a specific folder that will be nuked at the start of the test-run

@RonnyPfannschmidt RonnyPfannschmidt added the type: question general question, might be closed after 2 weeks of inactivity label Feb 3, 2022
@szabgab
Copy link
Contributor Author

szabgab commented Feb 3, 2022

Thanks. That solves the problem for me. Maybe the documentation could be amended with :

"The number of entries currently cannot be changed, but using the --basetemp option will remove the directory before every run effectively meaning the tempfiles of only the most recent run will be kept."

@nicoddemus
Copy link
Member

"The number of entries currently cannot be changed, but using the --basetemp option will remove the directory before every run effectively meaning the tempfiles of only the most recent run will be kept."

Sounds good, would you like to contribute that to the docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question general question, might be closed after 2 weeks of inactivity
Projects
None yet
Development

No branches or pull requests

3 participants