diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-10-13 16:59:13 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-10-13 18:05:25 +0200 |
commit | 779af13764ae694af907145901727f7b730bfc49 (patch) | |
tree | af2344e0c06d1e1a9b421e5207ec5e456ea806b7 /tests/helpers/fixtures.py | |
parent | 2a61e0dae003591d01821b25b59987b168fbbddb (diff) | |
download | qutebrowser-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.py | 13 |
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) |