parent
9d60cf25c0
commit
31f089db6a
|
@ -103,6 +103,22 @@ class Cache(object):
|
||||||
with f:
|
with f:
|
||||||
self.trace("cache-write %s: %r" % (key, value))
|
self.trace("cache-write %s: %r" % (key, value))
|
||||||
json.dump(value, f, indent=2, sort_keys=True)
|
json.dump(value, f, indent=2, sort_keys=True)
|
||||||
|
self._ensure_readme()
|
||||||
|
|
||||||
|
def _ensure_readme(self):
|
||||||
|
content_readme = '''# pytest cache directory #
|
||||||
|
|
||||||
|
This directory contains data from the pytest's cache plugin, \
|
||||||
|
which provides the `--lf` and `--ff` options, as well as the `cache` fixture.
|
||||||
|
|
||||||
|
**Do not** commit this to version control.
|
||||||
|
|
||||||
|
See [the docs](https://docs.pytest.org/en/latest/cache.html) for more information.
|
||||||
|
'''
|
||||||
|
if self._cachedir.check(dir=True):
|
||||||
|
readme_path = self._cachedir.join("README.md")
|
||||||
|
if not readme_path.check(file=True):
|
||||||
|
readme_path.write(content_readme)
|
||||||
|
|
||||||
|
|
||||||
class LFPlugin(object):
|
class LFPlugin(object):
|
||||||
|
|
Loading…
Reference in New Issue