From 2e8419db272d6116d3429d45b8339a166fc8a806 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 15 Sep 2017 17:22:50 +0200 Subject: [PATCH] Fix lint --- qutebrowser/config/config.py | 2 +- qutebrowser/config/configfiles.py | 2 +- qutebrowser/config/configtypes.py | 4 ++-- tests/helpers/fixtures.py | 1 - tests/unit/browser/test_tab.py | 2 -- tests/unit/config/test_config.py | 4 +++- tests/unit/config/test_configfiles.py | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 33a7b7d94..9cdf7f32c 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -688,4 +688,4 @@ def init(parent=None): plain_text=False) errbox.exec_() - configfiles.init(instance) + configfiles.init() diff --git a/qutebrowser/config/configfiles.py b/qutebrowser/config/configfiles.py index 1dd50d470..2e14fad53 100644 --- a/qutebrowser/config/configfiles.py +++ b/qutebrowser/config/configfiles.py @@ -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) diff --git a/qutebrowser/config/configtypes.py b/qutebrowser/config/configtypes.py index 32da0c704..14c4849b7 100644 --- a/qutebrowser/config/configtypes.py +++ b/qutebrowser/config/configtypes.py @@ -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): diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py index bd3f69a45..6cd038ce0 100644 --- a/tests/helpers/fixtures.py +++ b/tests/helpers/fixtures.py @@ -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 diff --git a/tests/unit/browser/test_tab.py b/tests/unit/browser/test_tab.py index d4bd48d08..e6b081f18 100644 --- a/tests/unit/browser/test_tab.py +++ b/tests/unit/browser/test_tab.py @@ -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') diff --git a/tests/unit/config/test_config.py b/tests/unit/config/test_config.py index b44fd0746..fbd41e7c6 100644 --- a/tests/unit/config/test_config.py +++ b/tests/unit/config/test_config.py @@ -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) diff --git a/tests/unit/config/test_configfiles.py b/tests/unit/config/test_configfiles.py index 2e3d88c61..a58854fed 100644 --- a/tests/unit/config/test_configfiles.py +++ b/tests/unit/config/test_configfiles.py @@ -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':