--cache-clear: add test for keeping non-supporting files
Ref: https://github.com/pytest-dev/pytest/pull/6296
This commit is contained in:
parent
a52f791461
commit
8f5fd537d8
|
@ -268,9 +268,11 @@ class TestLastFailed:
|
||||||
"*1 failed*2 passed*",
|
"*1 failed*2 passed*",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
testdir.tmpdir.join(".pytest_cache").mkdir(".git")
|
||||||
result = testdir.runpytest(str(p), "--lf", "--cache-clear")
|
result = testdir.runpytest(str(p), "--lf", "--cache-clear")
|
||||||
result.stdout.fnmatch_lines(["*1 failed*2 passed*"])
|
result.stdout.fnmatch_lines(["*1 failed*2 passed*"])
|
||||||
assert testdir.tmpdir.join(".pytest_cache", "README.md").isfile()
|
assert testdir.tmpdir.join(".pytest_cache", "README.md").isfile()
|
||||||
|
assert testdir.tmpdir.join(".pytest_cache", ".git").isdir()
|
||||||
|
|
||||||
# Run this again to make sure clear-cache is robust
|
# Run this again to make sure clear-cache is robust
|
||||||
if os.path.isdir(".pytest_cache"):
|
if os.path.isdir(".pytest_cache"):
|
||||||
|
|
Loading…
Reference in New Issue