-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add an environment variable to keep temporary directories when testing #5676
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
Conversation
It seems fine to me. Keeping the last N runs of temp files is actually the default behavior of py.test... we just override it because I think a full test run is something like 12GB of temporary files for us. |
Yes, ideally it should be some sort of command line flag (so people don't get surprised by forgetting to delete the env var) but IMO it's too niche a need to be worth that extra complexity. I never run the full test suite locally anyway, it takes way too long. But running one test to iterate on fixes for a CI failure does save time. |
If you want to add a CLI option, it's not very hard, you just add: def pytest_addoption(parser):
parser.addoption(
"--cmdopt", action="store", default="type1", help="my option: type1 or type2"
) to @pytest.fixture
def cmdopt(request):
return request.config.getoption("--cmdopt") See more details at https://docs.pytest.org/en/latest/example/simple.html#pass-different-values-to-a-test-function-depending-on-command-line-options. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do run the entire test suite locally regularly (it takes less time than Travis, due to more cores/threads).
This seems reasonable to me.
@dstufft Thanks for that - it is indeed nice & easy to add a command line option, so I've done that. |
That said, @dstufft's suggestion of making this a CLI flag would also work. Personally, I doubt I'd use this much and even when I do, both would work just fine so I don't feel strongly here. |
@pfmoore Nice timing. :P |
Pinging appveyor |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is a bit of a hack, but cleanup of temporary directories when trying to test locally is a real pain, and this gives a way out without needing to modify
conftest.py
.@pypa/pip-committers Does this seem like a reasonable addition, or is it too much of a hack?