summaryrefslogtreecommitdiff
path: root/tests/helpers/fixtures.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-10-13 16:59:13 +0200
committerFlorian Bruhin <me@the-compiler.org>2020-10-13 18:05:25 +0200
commit779af13764ae694af907145901727f7b730bfc49 (patch)
treeaf2344e0c06d1e1a9b421e5207ec5e456ea806b7 /tests/helpers/fixtures.py
parent2a61e0dae003591d01821b25b59987b168fbbddb (diff)
downloadqutebrowser-779af13764ae694af907145901727f7b730bfc49.tar.gz
qutebrowser-779af13764ae694af907145901727f7b730bfc49.zip
tests: Avoid mocking in CACHEDIR.tag test
See #5787
Diffstat (limited to 'tests/helpers/fixtures.py')
-rw-r--r--tests/helpers/fixtures.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py
index 7ab6956f0..2183ac1d1 100644
--- a/tests/helpers/fixtures.py
+++ b/tests/helpers/fixtures.py
@@ -709,3 +709,16 @@ def state_config(data_tmpdir, monkeypatch):
state = configfiles.StateConfig()
monkeypatch.setattr(configfiles, 'state', state)
return state
+
+
+@pytest.fixture
+def unwritable_tmp_path(tmp_path):
+ tmp_path.chmod(0)
+ if os.access(str(tmp_path), os.W_OK):
+ # Docker container or similar
+ pytest.skip("Directory was still writable")
+
+ yield tmp_path
+
+ # Make sure pytest can clean up the tmp_path
+ tmp_path.chmod(0o755)