From 8f5fd537d84286c6f5199695cc039a94c4699bb0 Mon Sep 17 00:00:00 2001
From: Daniel Hahler <git@thequod.de>
Date: Tue, 3 Dec 2019 10:45:52 +0100
Subject: [PATCH] --cache-clear: add test for keeping non-supporting files

Ref: https://github.com/pytest-dev/pytest/pull/6296
---
 testing/test_cacheprovider.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testing/test_cacheprovider.py b/testing/test_cacheprovider.py
index f0b279abf..e22c1c766 100644
--- a/testing/test_cacheprovider.py
+++ b/testing/test_cacheprovider.py
@@ -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"):