Merge pull request #6532 from blueyed/harden-test

--cache-clear: add test for keeping non-supporting files
This commit is contained in:
Daniel Hahler 2020-01-22 12:20:24 +01:00 committed by GitHub
commit 0f78ef8e02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -268,9 +268,11 @@ class TestLastFailed:
"*1 failed*2 passed*",
]
)
testdir.tmpdir.join(".pytest_cache").mkdir(".git")
result = testdir.runpytest(str(p), "--lf", "--cache-clear")
result.stdout.fnmatch_lines(["*1 failed*2 passed*"])
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
if os.path.isdir(".pytest_cache"):