diff --git a/tests/unit/config/test_config.py b/tests/unit/config/test_config.py index e471068e9..42eb20169 100644 --- a/tests/unit/config/test_config.py +++ b/tests/unit/config/test_config.py @@ -827,6 +827,10 @@ def init_patch(qapp, fake_save_manager, monkeypatch, config_tmpdir, yield objreg.delete('config') objreg.delete('config-commands') + try: + objreg.delete('state-config') + except KeyError: + pass def test_init(init_patch, fake_save_manager, config_tmpdir): diff --git a/tests/unit/config/test_configfiles.py b/tests/unit/config/test_configfiles.py index 8d912a4ed..b44598888 100644 --- a/tests/unit/config/test_configfiles.py +++ b/tests/unit/config/test_configfiles.py @@ -22,6 +22,7 @@ import pytest from qutebrowser.config import configfiles +from qutebrowser.utils import objreg from PyQt5.QtCore import QSettings @@ -86,8 +87,15 @@ def test_yaml_config(fake_save_manager, config_tmpdir, old_config, insert): assert ' tabs.show: never' in lines -def test_init(qapp, fake_save_manager, config_tmpdir, data_tmpdir, - config_stub): +@pytest.fixture +def init_patch(qapp, fake_save_manager, config_tmpdir, data_tmpdir, + config_stub): + yield + objreg.delete('state-config') + objreg.delete('command-history') + + +def test_init(init_patch, config_tmpdir): configfiles.init(config=None) # Make sure qsettings land in a subdir