Fix lint
This commit is contained in:
parent
14fe7f9b0b
commit
b5253ec473
@ -193,7 +193,7 @@ def _init_icon():
|
||||
icon = QIcon()
|
||||
fallback_icon = QIcon()
|
||||
for size in [16, 24, 32, 48, 64, 96, 128, 256, 512]:
|
||||
filename = ':/icons/qutebrowser-{}x{}.png'.format(size, size)
|
||||
filename = ':/icons/qutebrowser-{size}x{size}.png'.format(size=size)
|
||||
pixmap = QPixmap(filename)
|
||||
if pixmap.isNull():
|
||||
log.init.warning("Failed to load {}".format(filename))
|
||||
|
@ -280,6 +280,7 @@ class BackendImports:
|
||||
|
||||
def _try_import_backends():
|
||||
"""Check whether backends can be imported and return BackendImports."""
|
||||
# pylint: disable=unused-import
|
||||
results = BackendImports()
|
||||
|
||||
try:
|
||||
|
@ -133,7 +133,7 @@ def init_faulthandler(fileobj=sys.__stderr__):
|
||||
def check_pyqt_core():
|
||||
"""Check if PyQt core is installed."""
|
||||
try:
|
||||
import PyQt5.QtCore
|
||||
import PyQt5.QtCore # pylint: disable=unused-import
|
||||
except ImportError as e:
|
||||
text = _missing_str('PyQt5')
|
||||
text = text.replace('<b>', '')
|
||||
@ -188,7 +188,7 @@ def check_qt_version():
|
||||
def check_ssl_support():
|
||||
"""Check if SSL support is available."""
|
||||
try:
|
||||
from PyQt5.QtNetwork import QSslSocket
|
||||
from PyQt5.QtNetwork import QSslSocket # pylint: disable=unused-import
|
||||
except ImportError:
|
||||
_die("Fatal error: Your Qt is built without SSL support.")
|
||||
|
||||
|
@ -370,7 +370,7 @@ def main():
|
||||
if args.upload is not None:
|
||||
# Fail early when trying to upload without github3 installed
|
||||
# or without API token
|
||||
import github3
|
||||
import github3 # pylint: disable=unused-import
|
||||
read_github_token()
|
||||
|
||||
if args.no_asciidoc:
|
||||
|
@ -135,7 +135,7 @@ def _get_command_quickref(cmds):
|
||||
out.append('|Command|Description')
|
||||
for name, cmd in cmds:
|
||||
desc = inspect.getdoc(cmd.handler).splitlines()[0]
|
||||
out.append('|<<{},{}>>|{}'.format(name, name, desc))
|
||||
out.append('|<<{name},{name}>>|{desc}'.format(name=name, desc=desc))
|
||||
out.append('|==============')
|
||||
return '\n'.join(out)
|
||||
|
||||
|
@ -82,7 +82,8 @@ class Request(testprocess.Line):
|
||||
for i in range(15):
|
||||
path_to_statuses['/redirect/{}'.format(i)] = [HTTPStatus.FOUND]
|
||||
for suffix in ['', '1', '2', '3', '4', '5', '6']:
|
||||
key = '/basic-auth/user{}/password{}'.format(suffix, suffix)
|
||||
key = ('/basic-auth/user{suffix}/password{suffix}'
|
||||
.format(suffix=suffix))
|
||||
path_to_statuses[key] = [HTTPStatus.UNAUTHORIZED, HTTPStatus.OK]
|
||||
|
||||
default_statuses = [HTTPStatus.OK, HTTPStatus.NOT_MODIFIED]
|
||||
|
@ -82,14 +82,14 @@ def test_generate_pdfjs_script_disable_object_url(monkeypatch,
|
||||
if qt == 'new':
|
||||
monkeypatch.setattr(pdfjs.qtutils, 'version_check',
|
||||
lambda version, exact=False, compiled=True:
|
||||
False if version == '5.7.1' else True)
|
||||
version != '5.7.1')
|
||||
elif qt == 'old':
|
||||
monkeypatch.setattr(pdfjs.qtutils, 'version_check',
|
||||
lambda version, exact=False, compiled=True: False)
|
||||
elif qt == '5.7':
|
||||
monkeypatch.setattr(pdfjs.qtutils, 'version_check',
|
||||
lambda version, exact=False, compiled=True:
|
||||
True if version == '5.7.1' else False)
|
||||
version == '5.7.1')
|
||||
else:
|
||||
raise utils.Unreachable
|
||||
|
||||
|
@ -31,7 +31,7 @@ from qutebrowser.browser.webkit import http, rfc6266
|
||||
'attachment; filename="{}"',
|
||||
'inline; {}',
|
||||
'attachment; {}="foo"',
|
||||
'attachment; filename*=iso-8859-1''{}',
|
||||
"attachment; filename*=iso-8859-1''{}",
|
||||
'attachment; filename*={}',
|
||||
])
|
||||
@hypothesis.given(strategies.text(alphabet=[chr(x) for x in range(255)]))
|
||||
|
@ -73,7 +73,7 @@ def test_patched_errwindow(capfd, mocker, monkeypatch):
|
||||
monkeypatch.setattr(checkpyver.sys, 'exit', lambda status: None)
|
||||
|
||||
try:
|
||||
import tkinter
|
||||
import tkinter # pylint: disable=unused-import
|
||||
except ImportError:
|
||||
tk_mock = mocker.patch('qutebrowser.misc.checkpyver.Tk',
|
||||
spec=['withdraw'], new_callable=mocker.Mock)
|
||||
|
Loading…
Reference in New Issue
Block a user