Fix lint
This commit is contained in:
parent
c9625cb311
commit
2e8419db27
@ -688,4 +688,4 @@ def init(parent=None):
|
|||||||
plain_text=False)
|
plain_text=False)
|
||||||
errbox.exec_()
|
errbox.exec_()
|
||||||
|
|
||||||
configfiles.init(instance)
|
configfiles.init()
|
||||||
|
@ -220,7 +220,7 @@ def read_config_py(filename=None):
|
|||||||
return api
|
return api
|
||||||
|
|
||||||
|
|
||||||
def init(config):
|
def init():
|
||||||
"""Initialize config storage not related to the main config."""
|
"""Initialize config storage not related to the main config."""
|
||||||
state = StateConfig()
|
state = StateConfig()
|
||||||
objreg.register('state-config', state)
|
objreg.register('state-config', state)
|
||||||
|
@ -526,8 +526,8 @@ class Bool(BaseType):
|
|||||||
|
|
||||||
"""A boolean setting, either `true` or `false`.
|
"""A boolean setting, either `true` or `false`.
|
||||||
|
|
||||||
When setting from a string, `1`, `yes`, `on` and `true` count as true, while
|
When setting from a string, `1`, `yes`, `on` and `true` count as true,
|
||||||
`0`, `no`, `off` and `false` count as false (case-insensitive).
|
while `0`, `no`, `off` and `false` count as false (case-insensitive).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, none_ok=False):
|
def __init__(self, none_ok=False):
|
||||||
|
@ -32,7 +32,6 @@ import itertools
|
|||||||
import textwrap
|
import textwrap
|
||||||
import unittest.mock
|
import unittest.mock
|
||||||
import types
|
import types
|
||||||
import os
|
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import py.path # pylint: disable=no-name-in-module
|
import py.path # pylint: disable=no-name-in-module
|
||||||
|
@ -22,8 +22,6 @@ import pytest
|
|||||||
from PyQt5.QtCore import PYQT_VERSION
|
from PyQt5.QtCore import PYQT_VERSION
|
||||||
|
|
||||||
from qutebrowser.browser import browsertab
|
from qutebrowser.browser import browsertab
|
||||||
from qutebrowser.keyinput import modeman
|
|
||||||
from qutebrowser.utils import objreg
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.usefixtures('redirect_webengine_data')
|
pytestmark = pytest.mark.usefixtures('redirect_webengine_data')
|
||||||
|
|
||||||
|
@ -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('load_autoconfig', [True, False]) # noqa
|
||||||
@pytest.mark.parametrize('config_py', [True, 'error', False])
|
@pytest.mark.parametrize('config_py', [True, 'error', False])
|
||||||
@pytest.mark.parametrize('invalid_yaml', ['42', 'unknown', 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,
|
def test_init(init_patch, fake_save_manager, config_tmpdir, mocker,
|
||||||
load_autoconfig, config_py, invalid_yaml):
|
load_autoconfig, config_py, invalid_yaml):
|
||||||
# Prepare files
|
# 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')
|
config_py_lines.append('config.load_autoconfig = False')
|
||||||
if config_py == 'error':
|
if config_py == 'error':
|
||||||
config_py_lines.append('c.foo = 42')
|
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',
|
msgbox_mock = mocker.patch('qutebrowser.config.config.msgbox.msgbox',
|
||||||
autospec=True)
|
autospec=True)
|
||||||
|
@ -324,7 +324,7 @@ def init_patch(qapp, fake_save_manager, config_tmpdir, data_tmpdir,
|
|||||||
|
|
||||||
|
|
||||||
def test_init(init_patch, config_tmpdir):
|
def test_init(init_patch, config_tmpdir):
|
||||||
configfiles.init(config=None)
|
configfiles.init()
|
||||||
|
|
||||||
# Make sure qsettings land in a subdir
|
# Make sure qsettings land in a subdir
|
||||||
if sys.platform == 'linux':
|
if sys.platform == 'linux':
|
||||||
|
Loading…
Reference in New Issue
Block a user