Make --cache-show output deterministic
This makes sure things don't jump around in the regenerated docs.
This commit is contained in:
parent
f9df750025
commit
d9b93674c3
|
@ -219,7 +219,7 @@ def cacheshow(config, session):
|
||||||
basedir = config.cache._cachedir
|
basedir = config.cache._cachedir
|
||||||
vdir = basedir.join("v")
|
vdir = basedir.join("v")
|
||||||
tw.sep("-", "cache values")
|
tw.sep("-", "cache values")
|
||||||
for valpath in vdir.visit(lambda x: x.isfile()):
|
for valpath in sorted(vdir.visit(lambda x: x.isfile())):
|
||||||
key = valpath.relto(vdir).replace(valpath.sep, "/")
|
key = valpath.relto(vdir).replace(valpath.sep, "/")
|
||||||
val = config.cache.get(key, dummy)
|
val = config.cache.get(key, dummy)
|
||||||
if val is dummy:
|
if val is dummy:
|
||||||
|
@ -235,7 +235,7 @@ def cacheshow(config, session):
|
||||||
ddir = basedir.join("d")
|
ddir = basedir.join("d")
|
||||||
if ddir.isdir() and ddir.listdir():
|
if ddir.isdir() and ddir.listdir():
|
||||||
tw.sep("-", "cache directories")
|
tw.sep("-", "cache directories")
|
||||||
for p in basedir.join("d").visit():
|
for p in sorted(basedir.join("d").visit()):
|
||||||
#if p.check(dir=1):
|
#if p.check(dir=1):
|
||||||
# print("%s/" % p.relto(basedir))
|
# print("%s/" % p.relto(basedir))
|
||||||
if p.isfile():
|
if p.isfile():
|
||||||
|
|
|
@ -231,10 +231,10 @@ You can always peek at the content of the cache using the
|
||||||
rootdir: $REGENDOC_TMPDIR, inifile:
|
rootdir: $REGENDOC_TMPDIR, inifile:
|
||||||
cachedir: $REGENDOC_TMPDIR/.cache
|
cachedir: $REGENDOC_TMPDIR/.cache
|
||||||
------------------------------- cache values -------------------------------
|
------------------------------- cache values -------------------------------
|
||||||
example/value contains:
|
|
||||||
42
|
|
||||||
cache/lastfailed contains:
|
cache/lastfailed contains:
|
||||||
{'test_caching.py::test_function': True}
|
{'test_caching.py::test_function': True}
|
||||||
|
example/value contains:
|
||||||
|
42
|
||||||
|
|
||||||
======= no tests ran in 0.12 seconds ========
|
======= no tests ran in 0.12 seconds ========
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue