Make sure temporary dir exists

This seems to be enforced with Qt 5.12
See #4025
This commit is contained in:
Florian Bruhin 2018-06-27 12:53:29 +02:00
parent 9a14574c9f
commit 41303ecfcf

View File

@ -183,10 +183,13 @@ class TestStandardDir:
@pytest.mark.qt_log_ignore(r'^QStandardPaths: ')
def test_linux_invalid_runtimedir(self, monkeypatch, tmpdir):
"""With invalid XDG_RUNTIME_DIR, fall back to TempLocation."""
tmpdir_env = tmpdir / 'temp'
tmpdir_env.ensure(dir=True)
monkeypatch.setenv('XDG_RUNTIME_DIR', str(tmpdir / 'does-not-exist'))
monkeypatch.setenv('TMPDIR', str(tmpdir / 'temp'))
monkeypatch.setenv('TMPDIR', tmpdir_env)
standarddir._init_dirs()
assert standarddir.runtime() == str(tmpdir / 'temp' / APPNAME)
assert standarddir.runtime() == str(tmpdir_env / APPNAME)
@pytest.mark.fake_os('windows')
def test_runtimedir_empty_tempdir(self, monkeypatch, tmpdir):