From d8096925fac4093deda89bc952e12e46bb9557ab Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 5 Nov 2019 23:04:27 +0100 Subject: [PATCH] Fix for Python 3.5 not handling LocalPath --- testing/test_cacheprovider.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testing/test_cacheprovider.py b/testing/test_cacheprovider.py index 6a5a5af8b..3f03b5ff9 100644 --- a/testing/test_cacheprovider.py +++ b/testing/test_cacheprovider.py @@ -46,7 +46,8 @@ class TestNewAPI: ) def test_cache_writefail_permissions(self, testdir): testdir.makeini("[pytest]") - mode = os.stat(testdir.tmpdir.ensure_dir(".pytest_cache"))[stat.ST_MODE] + cache_dir = str(testdir.tmpdir.ensure_dir(".pytest_cache")) + mode = os.stat(cache_dir)[stat.ST_MODE] testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0) try: config = testdir.parseconfigure() @@ -60,7 +61,8 @@ class TestNewAPI: "ignore:could not create cache path:pytest.PytestWarning" ) def test_cache_failure_warns(self, testdir): - mode = os.stat(testdir.tmpdir.ensure_dir(".pytest_cache"))[stat.ST_MODE] + cache_dir = str(testdir.tmpdir.ensure_dir(".pytest_cache")) + mode = os.stat(cache_dir)[stat.ST_MODE] testdir.tmpdir.ensure_dir(".pytest_cache").chmod(0) try: testdir.makepyfile(