Skip to content

Commit d809692

Browse files
committed
Fix for Python 3.5 not handling LocalPath
1 parent 9309ae2 commit d809692

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testing/test_cacheprovider.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def test_cache_writefail_cachfile_silent(self, testdir):
4646
)
4747
def test_cache_writefail_permissions(self, testdir):
4848
testdir.makeini("[pytest]")
49-
mode = os.stat(testdir.tmpdir.ensure_dir(".pytest_cache"))[stat.ST_MODE]
49+
cache_dir = str(testdir.tmpdir.ensure_dir(".pytest_cache"))
50+
mode = os.stat(cache_dir)[stat.ST_MODE]
5051
testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0)
5152
try:
5253
config = testdir.parseconfigure()
@@ -60,7 +61,8 @@ def test_cache_writefail_permissions(self, testdir):
6061
"ignore:could not create cache path:pytest.PytestWarning"
6162
)
6263
def test_cache_failure_warns(self, testdir):
63-
mode = os.stat(testdir.tmpdir.ensure_dir(".pytest_cache"))[stat.ST_MODE]
64+
cache_dir = str(testdir.tmpdir.ensure_dir(".pytest_cache"))
65+
mode = os.stat(cache_dir)[stat.ST_MODE]
6466
testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0)
6567
try:
6668
testdir.makepyfile(

0 commit comments

Comments
 (0)