From d9b546701ecb962e5edd4fdb4ca2f28f80be549b Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Thu, 14 Jul 2016 20:07:11 -0400 Subject: [PATCH] Prevent creation of user dirs on several tests. Use the config_tempdir and data_tempdir fixtures for several tests that were creation ~/.config/qute_test or ~/.local/share/qute_test. --- tests/unit/browser/webkit/test_cookies.py | 2 ++ tests/unit/config/test_config.py | 2 ++ tests/unit/config/test_configtypes.py | 2 ++ tests/unit/config/test_configtypes_hypothesis.py | 2 +- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/unit/browser/webkit/test_cookies.py b/tests/unit/browser/webkit/test_cookies.py index 2d764af42..bcee01e60 100644 --- a/tests/unit/browser/webkit/test_cookies.py +++ b/tests/unit/browser/webkit/test_cookies.py @@ -24,6 +24,8 @@ import pytest from qutebrowser.browser.webkit import cookies from qutebrowser.misc import lineparser +pytestmark = pytest.mark.usefixtures('data_tmpdir') + CONFIG_ALL_COOKIES = {'content': {'cookies-accept': 'all'}} CONFIG_NEVER_COOKIES = {'content': {'cookies-accept': 'never'}} CONFIG_COOKIES_ENABLED = {'content': {'cookies-store': True}} diff --git a/tests/unit/config/test_config.py b/tests/unit/config/test_config.py index 256aac03f..abb1d542b 100644 --- a/tests/unit/config/test_config.py +++ b/tests/unit/config/test_config.py @@ -35,6 +35,8 @@ from qutebrowser.config.parsers import keyconf from qutebrowser.commands import runners from qutebrowser.utils import objreg, standarddir +pytestmark = pytest.mark.usefixtures('config_tmpdir') + class TestConfigParser: diff --git a/tests/unit/config/test_configtypes.py b/tests/unit/config/test_configtypes.py index 6998d86cd..648bb393f 100644 --- a/tests/unit/config/test_configtypes.py +++ b/tests/unit/config/test_configtypes.py @@ -33,6 +33,8 @@ from PyQt5.QtNetwork import QNetworkProxy from qutebrowser.config import configtypes, configexc from qutebrowser.utils import debug, utils +pytestmark = pytest.mark.usefixtures('config_tmpdir') + class Font(QFont): diff --git a/tests/unit/config/test_configtypes_hypothesis.py b/tests/unit/config/test_configtypes_hypothesis.py index fe7807c4a..c5a5b9ac0 100644 --- a/tests/unit/config/test_configtypes_hypothesis.py +++ b/tests/unit/config/test_configtypes_hypothesis.py @@ -42,7 +42,7 @@ def gen_classes(): yield member -@pytest.mark.usefixtures('qapp') +@pytest.mark.usefixtures('qapp', 'config_tmpdir') @pytest.mark.parametrize('klass', gen_classes()) @hypothesis.given(strategies.text()) @hypothesis.example('\x00')