Fix for Python 3.5 not handling LocalPath

This commit is contained in:
Daniel Hahler 2019-11-05 23:04:27 +01:00
parent 9309ae299a
commit d8096925fa
1 changed files with 4 additions and 2 deletions

View File

@ -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(