Clean up objreg properly in config tests
This commit is contained in:
parent
54adf3898a
commit
f8a88ae042
@ -827,6 +827,10 @@ def init_patch(qapp, fake_save_manager, monkeypatch, config_tmpdir,
|
|||||||
yield
|
yield
|
||||||
objreg.delete('config')
|
objreg.delete('config')
|
||||||
objreg.delete('config-commands')
|
objreg.delete('config-commands')
|
||||||
|
try:
|
||||||
|
objreg.delete('state-config')
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def test_init(init_patch, fake_save_manager, config_tmpdir):
|
def test_init(init_patch, fake_save_manager, config_tmpdir):
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from qutebrowser.config import configfiles
|
from qutebrowser.config import configfiles
|
||||||
|
from qutebrowser.utils import objreg
|
||||||
|
|
||||||
from PyQt5.QtCore import QSettings
|
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
|
assert ' tabs.show: never' in lines
|
||||||
|
|
||||||
|
|
||||||
def test_init(qapp, fake_save_manager, config_tmpdir, data_tmpdir,
|
@pytest.fixture
|
||||||
|
def init_patch(qapp, fake_save_manager, config_tmpdir, data_tmpdir,
|
||||||
config_stub):
|
config_stub):
|
||||||
|
yield
|
||||||
|
objreg.delete('state-config')
|
||||||
|
objreg.delete('command-history')
|
||||||
|
|
||||||
|
|
||||||
|
def test_init(init_patch, config_tmpdir):
|
||||||
configfiles.init(config=None)
|
configfiles.init(config=None)
|
||||||
|
|
||||||
# Make sure qsettings land in a subdir
|
# Make sure qsettings land in a subdir
|
||||||
|
Loading…
Reference in New Issue
Block a user