This commit is contained in:
Florian Bruhin 2017-09-15 17:22:50 +02:00
parent c9625cb311
commit 2e8419db27
7 changed files with 8 additions and 9 deletions

View File

@ -688,4 +688,4 @@ def init(parent=None):
plain_text=False)
errbox.exec_()
configfiles.init(instance)
configfiles.init()

View File

@ -220,7 +220,7 @@ def read_config_py(filename=None):
return api
def init(config):
def init():
"""Initialize config storage not related to the main config."""
state = StateConfig()
objreg.register('state-config', state)

View File

@ -526,8 +526,8 @@ class Bool(BaseType):
"""A boolean setting, either `true` or `false`.
When setting from a string, `1`, `yes`, `on` and `true` count as true, while
`0`, `no`, `off` and `false` count as false (case-insensitive).
When setting from a string, `1`, `yes`, `on` and `true` count as true,
while `0`, `no`, `off` and `false` count as false (case-insensitive).
"""
def __init__(self, none_ok=False):

View File

@ -32,7 +32,6 @@ import itertools
import textwrap
import unittest.mock
import types
import os
import pytest
import py.path # pylint: disable=no-name-in-module

View File

@ -22,8 +22,6 @@ import pytest
from PyQt5.QtCore import PYQT_VERSION
from qutebrowser.browser import browsertab
from qutebrowser.keyinput import modeman
from qutebrowser.utils import objreg
pytestmark = pytest.mark.usefixtures('redirect_webengine_data')

View File

@ -883,6 +883,7 @@ def init_patch(qapp, fake_save_manager, monkeypatch, config_tmpdir,
@pytest.mark.parametrize('load_autoconfig', [True, False]) # noqa
@pytest.mark.parametrize('config_py', [True, 'error', False])
@pytest.mark.parametrize('invalid_yaml', ['42', 'unknown', False])
# pylint: disable=too-many-branches
def test_init(init_patch, fake_save_manager, config_tmpdir, mocker,
load_autoconfig, config_py, invalid_yaml):
# Prepare files
@ -905,7 +906,8 @@ def test_init(init_patch, fake_save_manager, config_tmpdir, mocker,
config_py_lines.append('config.load_autoconfig = False')
if config_py == 'error':
config_py_lines.append('c.foo = 42')
config_py_file.write_text('\n'.join(config_py_lines), 'utf-8', ensure=True)
config_py_file.write_text('\n'.join(config_py_lines),
'utf-8', ensure=True)
msgbox_mock = mocker.patch('qutebrowser.config.config.msgbox.msgbox',
autospec=True)

View File

@ -324,7 +324,7 @@ def init_patch(qapp, fake_save_manager, config_tmpdir, data_tmpdir,
def test_init(init_patch, config_tmpdir):
configfiles.init(config=None)
configfiles.init()
# Make sure qsettings land in a subdir
if sys.platform == 'linux':