summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2018-06-27 12:53:29 +0200
committerFlorian Bruhin <git@the-compiler.org>2018-07-02 22:32:59 +0200
commit41303ecfcfad4d8c054cc113c0065ff016033d24 (patch)
tree15e52f70c6db3491fea56110575b753c46acc5ce
parent9a14574c9f87d3e8937b513746bd222b5e5e319c (diff)
downloadqutebrowser-41303ecfcfad4d8c054cc113c0065ff016033d24.tar.gz
qutebrowser-41303ecfcfad4d8c054cc113c0065ff016033d24.zip
Make sure temporary dir exists
This seems to be enforced with Qt 5.12 See #4025
-rw-r--r--tests/unit/utils/test_standarddir.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/unit/utils/test_standarddir.py b/tests/unit/utils/test_standarddir.py
index a483ede64..b9777f670 100644
--- a/tests/unit/utils/test_standarddir.py
+++ b/tests/unit/utils/test_standarddir.py
@@ -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):