Skip to content

pytest always creates the .cache directory even when the cache functionality is not used #1342

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

Closed
svetlin-mladenov opened this issue Jan 25, 2016 · 0 comments
Labels
plugin: cache related to the cache builtin plugin status: help wanted developers would like help from experts on this topic type: enhancement new feature or API change, should be merged into features branch

Comments

@svetlin-mladenov
Copy link

pytest creates the .cache directory even when no tests are actually executed and the cache functionality is not used at all. In a sense the user pays for what they are not using.

Here is an example where no tests are actually run:

rm .cache/ -rf
truncate empty.py --size 0
py.test empty.py # warns that no tests were run
ls -lad .cache # suprise !

In this example only a single empty test is run but still .cache is created:

rm .cache/ -rf
echo -e "def test_minimal():\n    pass" > minimal.py
py.test minimal.py
ls -lad .cache # suprise !

This issue is clearly related to issue #1029 but is not limited to read-only file systems.

@RonnyPfannschmidt RonnyPfannschmidt added type: enhancement new feature or API change, should be merged into features branch status: help wanted developers would like help from experts on this topic plugin: cache related to the cache builtin plugin labels Jan 26, 2016
RonnyPfannschmidt added a commit that referenced this issue Mar 11, 2016
LastFailed now creates .cache only when needed. Fixes #1342
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: cache related to the cache builtin plugin status: help wanted developers would like help from experts on this topic type: enhancement new feature or API change, should be merged into features branch
Projects
None yet
Development

No branches or pull requests

2 participants