pylint: Re-enable bad-continuation
And lots and lots of whitespace changes.
This commit is contained in:
parent
93cd200bb7
commit
e65c0dd8a7
@ -16,7 +16,6 @@ enable=all
|
|||||||
disable=fixme,
|
disable=fixme,
|
||||||
no-self-use,
|
no-self-use,
|
||||||
cyclic-import,
|
cyclic-import,
|
||||||
bad-continuation,
|
|
||||||
blacklisted-name,
|
blacklisted-name,
|
||||||
logging-format-interpolation,
|
logging-format-interpolation,
|
||||||
broad-except,
|
broad-except,
|
||||||
|
@ -564,8 +564,8 @@ class Quitter:
|
|||||||
cwd = os.path.abspath(os.path.dirname(sys.executable))
|
cwd = os.path.abspath(os.path.dirname(sys.executable))
|
||||||
else:
|
else:
|
||||||
args = [sys.executable, '-m', 'qutebrowser']
|
args = [sys.executable, '-m', 'qutebrowser']
|
||||||
cwd = os.path.join(os.path.abspath(os.path.dirname(
|
cwd = os.path.join(
|
||||||
qutebrowser.__file__)), '..')
|
os.path.abspath(os.path.dirname(qutebrowser.__file__)), '..')
|
||||||
if not os.path.isdir(cwd):
|
if not os.path.isdir(cwd):
|
||||||
# Probably running from a python egg. Let's fallback to
|
# Probably running from a python egg. Let's fallback to
|
||||||
# cwd=None and see if that works out.
|
# cwd=None and see if that works out.
|
||||||
|
@ -247,8 +247,8 @@ class Completer(QObject):
|
|||||||
if func != self._last_completion_func:
|
if func != self._last_completion_func:
|
||||||
self._last_completion_func = func
|
self._last_completion_func = func
|
||||||
args = (x for x in before_cursor[1:] if not x.startswith('-'))
|
args = (x for x in before_cursor[1:] if not x.startswith('-'))
|
||||||
with debug.log_time(log.completion,
|
with debug.log_time(log.completion, 'Starting {} completion'
|
||||||
'Starting {} completion'.format(func.__name__)):
|
.format(func.__name__)):
|
||||||
info = CompletionInfo(config=config.instance,
|
info = CompletionInfo(config=config.instance,
|
||||||
keyconf=config.key_instance,
|
keyconf=config.key_instance,
|
||||||
win_id=self._win_id)
|
win_id=self._win_id)
|
||||||
|
@ -60,7 +60,8 @@ def value(optname, *_values, info):
|
|||||||
|
|
||||||
opt = info.config.get_opt(optname)
|
opt = info.config.get_opt(optname)
|
||||||
default = opt.typ.to_str(opt.default)
|
default = opt.typ.to_str(opt.default)
|
||||||
cur_cat = listcategory.ListCategory("Current/Default",
|
cur_cat = listcategory.ListCategory(
|
||||||
|
"Current/Default",
|
||||||
[(current, "Current value"), (default, "Default value")])
|
[(current, "Current value"), (default, "Default value")])
|
||||||
model.add_category(cur_cat)
|
model.add_category(cur_cat)
|
||||||
|
|
||||||
|
@ -111,9 +111,11 @@ class ExternalEditor(QObject):
|
|||||||
# the file from the external editor, see
|
# the file from the external editor, see
|
||||||
# https://github.com/qutebrowser/qutebrowser/issues/1767
|
# https://github.com/qutebrowser/qutebrowser/issues/1767
|
||||||
with tempfile.NamedTemporaryFile(
|
with tempfile.NamedTemporaryFile(
|
||||||
|
# pylint: disable=bad-continuation
|
||||||
mode='w', prefix='qutebrowser-editor-',
|
mode='w', prefix='qutebrowser-editor-',
|
||||||
encoding=config.val.editor.encoding,
|
encoding=config.val.editor.encoding,
|
||||||
delete=False) as fobj:
|
delete=False) as fobj:
|
||||||
|
# pylint: enable=bad-continuation
|
||||||
if text:
|
if text:
|
||||||
fobj.write(text)
|
fobj.write(text)
|
||||||
self._filename = fobj.name
|
self._filename = fobj.name
|
||||||
|
@ -74,7 +74,8 @@ def get_argparser():
|
|||||||
"session even if one would be restored.",
|
"session even if one would be restored.",
|
||||||
action='store_true')
|
action='store_true')
|
||||||
parser.add_argument('--target', choices=['auto', 'tab', 'tab-bg',
|
parser.add_argument('--target', choices=['auto', 'tab', 'tab-bg',
|
||||||
'tab-silent', 'tab-bg-silent', 'window'],
|
'tab-silent', 'tab-bg-silent',
|
||||||
|
'window'],
|
||||||
help="How URLs should be opened if there is already a "
|
help="How URLs should be opened if there is already a "
|
||||||
"qutebrowser instance running.")
|
"qutebrowser instance running.")
|
||||||
parser.add_argument('--backend', choices=['webkit', 'webengine'],
|
parser.add_argument('--backend', choices=['webkit', 'webengine'],
|
||||||
|
@ -361,29 +361,29 @@ def qt_message_handler(msg_type, context, msg):
|
|||||||
suppressed_msgs = [
|
suppressed_msgs = [
|
||||||
# PNGs in Qt with broken color profile
|
# PNGs in Qt with broken color profile
|
||||||
# https://bugreports.qt.io/browse/QTBUG-39788
|
# https://bugreports.qt.io/browse/QTBUG-39788
|
||||||
'libpng warning: iCCP: Not recognizing known sRGB profile that has '
|
('libpng warning: iCCP: Not recognizing known sRGB profile that has '
|
||||||
'been edited', # noqa: E131
|
'been edited'),
|
||||||
'libpng warning: iCCP: known incorrect sRGB profile',
|
'libpng warning: iCCP: known incorrect sRGB profile',
|
||||||
# Hopefully harmless warning
|
# Hopefully harmless warning
|
||||||
'OpenType support missing for script ',
|
'OpenType support missing for script ',
|
||||||
# Error if a QNetworkReply gets two different errors set. Harmless Qt
|
# Error if a QNetworkReply gets two different errors set. Harmless Qt
|
||||||
# bug on some pages.
|
# bug on some pages.
|
||||||
# https://bugreports.qt.io/browse/QTBUG-30298
|
# https://bugreports.qt.io/browse/QTBUG-30298
|
||||||
'QNetworkReplyImplPrivate::error: Internal problem, this method must '
|
('QNetworkReplyImplPrivate::error: Internal problem, this method must '
|
||||||
'only be called once.',
|
'only be called once.'),
|
||||||
# Sometimes indicates missing text, but most of the time harmless
|
# Sometimes indicates missing text, but most of the time harmless
|
||||||
'load glyph failed ',
|
'load glyph failed ',
|
||||||
# Harmless, see https://bugreports.qt.io/browse/QTBUG-42479
|
# Harmless, see https://bugreports.qt.io/browse/QTBUG-42479
|
||||||
'content-type missing in HTTP POST, defaulting to '
|
('content-type missing in HTTP POST, defaulting to '
|
||||||
'application/x-www-form-urlencoded. '
|
'application/x-www-form-urlencoded. '
|
||||||
'Use QNetworkRequest::setHeader() to fix this problem.',
|
'Use QNetworkRequest::setHeader() to fix this problem.'),
|
||||||
# https://bugreports.qt.io/browse/QTBUG-43118
|
# https://bugreports.qt.io/browse/QTBUG-43118
|
||||||
'Using blocking call!',
|
'Using blocking call!',
|
||||||
# Hopefully harmless
|
# Hopefully harmless
|
||||||
'"Method "GetAll" with signature "s" on interface '
|
('"Method "GetAll" with signature "s" on interface '
|
||||||
'"org.freedesktop.DBus.Properties" doesn\'t exist',
|
'"org.freedesktop.DBus.Properties" doesn\'t exist'),
|
||||||
'"Method \\"GetAll\\" with signature \\"s\\" on interface '
|
('"Method \\"GetAll\\" with signature \\"s\\" on interface '
|
||||||
'\\"org.freedesktop.DBus.Properties\\" doesn\'t exist\\n"',
|
'\\"org.freedesktop.DBus.Properties\\" doesn\'t exist\\n"'),
|
||||||
'WOFF support requires QtWebKit to be built with zlib support.',
|
'WOFF support requires QtWebKit to be built with zlib support.',
|
||||||
# Weird Enlightment/GTK X extensions
|
# Weird Enlightment/GTK X extensions
|
||||||
'QXcbWindow: Unhandled client message: "_E_',
|
'QXcbWindow: Unhandled client message: "_E_',
|
||||||
@ -392,21 +392,21 @@ def qt_message_handler(msg_type, context, msg):
|
|||||||
# Happens on AppVeyor CI
|
# Happens on AppVeyor CI
|
||||||
'SetProcessDpiAwareness failed:',
|
'SetProcessDpiAwareness failed:',
|
||||||
# https://bugreports.qt.io/browse/QTBUG-49174
|
# https://bugreports.qt.io/browse/QTBUG-49174
|
||||||
'QObject::connect: Cannot connect (null)::stateChanged('
|
('QObject::connect: Cannot connect (null)::stateChanged('
|
||||||
'QNetworkSession::State) to '
|
'QNetworkSession::State) to '
|
||||||
'QNetworkReplyHttpImpl::_q_networkSessionStateChanged('
|
'QNetworkReplyHttpImpl::_q_networkSessionStateChanged('
|
||||||
'QNetworkSession::State)',
|
'QNetworkSession::State)'),
|
||||||
# https://bugreports.qt.io/browse/QTBUG-53989
|
# https://bugreports.qt.io/browse/QTBUG-53989
|
||||||
"Image of format '' blocked because it is not considered safe. If you "
|
("Image of format '' blocked because it is not considered safe. If "
|
||||||
"are sure it is safe to do so, you can white-list the format by "
|
"you are sure it is safe to do so, you can white-list the format by "
|
||||||
"setting the environment variable QTWEBKIT_IMAGEFORMAT_WHITELIST=",
|
"setting the environment variable QTWEBKIT_IMAGEFORMAT_WHITELIST="),
|
||||||
# Installing Qt from the installer may cause it looking for SSL3 or
|
# Installing Qt from the installer may cause it looking for SSL3 or
|
||||||
# OpenSSL 1.0 which may not be available on the system
|
# OpenSSL 1.0 which may not be available on the system
|
||||||
"QSslSocket: cannot resolve ",
|
"QSslSocket: cannot resolve ",
|
||||||
"QSslSocket: cannot call unresolved function ",
|
"QSslSocket: cannot call unresolved function ",
|
||||||
# When enabling debugging with QtWebEngine
|
# When enabling debugging with QtWebEngine
|
||||||
"Remote debugging server started successfully. Try pointing a "
|
("Remote debugging server started successfully. Try pointing a "
|
||||||
"Chromium-based browser to ",
|
"Chromium-based browser to "),
|
||||||
# https://github.com/qutebrowser/qutebrowser/issues/1287
|
# https://github.com/qutebrowser/qutebrowser/issues/1287
|
||||||
"QXcbClipboard: SelectionRequest too old",
|
"QXcbClipboard: SelectionRequest too old",
|
||||||
# https://github.com/qutebrowser/qutebrowser/issues/2071
|
# https://github.com/qutebrowser/qutebrowser/issues/2071
|
||||||
@ -420,8 +420,8 @@ def qt_message_handler(msg_type, context, msg):
|
|||||||
suppressed_msgs += [
|
suppressed_msgs += [
|
||||||
'libpng warning: iCCP: known incorrect sRGB profile',
|
'libpng warning: iCCP: known incorrect sRGB profile',
|
||||||
# https://bugreports.qt.io/browse/QTBUG-47154
|
# https://bugreports.qt.io/browse/QTBUG-47154
|
||||||
'virtual void QSslSocketBackendPrivate::transmit() SSLRead failed '
|
('virtual void QSslSocketBackendPrivate::transmit() SSLRead '
|
||||||
'with: -9805', # noqa: E131
|
'failed with: -9805'),
|
||||||
]
|
]
|
||||||
|
|
||||||
if not msg:
|
if not msg:
|
||||||
|
@ -212,8 +212,7 @@ class AsciiDoc:
|
|||||||
|
|
||||||
for dst, link_name in [
|
for dst, link_name in [
|
||||||
('README.html', 'index.html'),
|
('README.html', 'index.html'),
|
||||||
(os.path.join('doc', 'quickstart.html'), 'quickstart.html'),
|
(os.path.join('doc', 'quickstart.html'), 'quickstart.html')]:
|
||||||
]:
|
|
||||||
try:
|
try:
|
||||||
os.symlink(dst, os.path.join(outdir, link_name))
|
os.symlink(dst, os.path.join(outdir, link_name))
|
||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
|
@ -118,9 +118,9 @@ def main():
|
|||||||
pip_bin = os.path.join(tmpdir, 'bin', 'pip')
|
pip_bin = os.path.join(tmpdir, 'bin', 'pip')
|
||||||
subprocess.run(['virtualenv', tmpdir], check=True)
|
subprocess.run(['virtualenv', tmpdir], check=True)
|
||||||
subprocess.run([pip_bin, 'install', '-r', filename], check=True)
|
subprocess.run([pip_bin, 'install', '-r', filename], check=True)
|
||||||
reqs = subprocess.run([pip_bin, 'freeze'], check=True,
|
proc = subprocess.run([pip_bin, 'freeze'], check=True,
|
||||||
stdout=subprocess.PIPE
|
stdout=subprocess.PIPE)
|
||||||
).stdout.decode('utf-8')
|
reqs = proc.stdout.decode('utf-8')
|
||||||
|
|
||||||
with open(filename, 'r', encoding='utf-8') as f:
|
with open(filename, 'r', encoding='utf-8') as f:
|
||||||
comments = read_comments(f)
|
comments = read_comments(f)
|
||||||
|
@ -108,7 +108,8 @@ def get_argparser():
|
|||||||
install_parser = subparsers.add_parser('install',
|
install_parser = subparsers.add_parser('install',
|
||||||
help='Install dictionaries')
|
help='Install dictionaries')
|
||||||
install_parser.add_argument('language',
|
install_parser.add_argument('language',
|
||||||
nargs='*', help="A list of languages to install.")
|
nargs='*',
|
||||||
|
help="A list of languages to install.")
|
||||||
|
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
@ -246,22 +246,22 @@ def import_netscape_bookmarks(bookmarks_file, bookmark_types, output_format):
|
|||||||
def import_moz_places(profile, bookmark_types, output_format):
|
def import_moz_places(profile, bookmark_types, output_format):
|
||||||
"""Import bookmarks from a Mozilla profile's places.sqlite database."""
|
"""Import bookmarks from a Mozilla profile's places.sqlite database."""
|
||||||
place_query = {
|
place_query = {
|
||||||
'bookmark':
|
'bookmark': (
|
||||||
("SELECT DISTINCT moz_bookmarks.title,moz_places.url "
|
"SELECT DISTINCT moz_bookmarks.title,moz_places.url "
|
||||||
"FROM moz_bookmarks,moz_places "
|
"FROM moz_bookmarks,moz_places "
|
||||||
"WHERE moz_places.id=moz_bookmarks.fk "
|
"WHERE moz_places.id=moz_bookmarks.fk "
|
||||||
"AND moz_places.id NOT IN (SELECT place_id FROM moz_keywords) "
|
"AND moz_places.id NOT IN (SELECT place_id FROM moz_keywords) "
|
||||||
"AND moz_places.url NOT LIKE 'place:%';"
|
"AND moz_places.url NOT LIKE 'place:%';"
|
||||||
), # Bookmarks with no keywords assigned
|
), # Bookmarks with no keywords assigned
|
||||||
'keyword':
|
'keyword': (
|
||||||
("SELECT moz_keywords.keyword,moz_places.url "
|
"SELECT moz_keywords.keyword,moz_places.url "
|
||||||
"FROM moz_keywords,moz_places,moz_bookmarks "
|
"FROM moz_keywords,moz_places,moz_bookmarks "
|
||||||
"WHERE moz_places.id=moz_bookmarks.fk "
|
"WHERE moz_places.id=moz_bookmarks.fk "
|
||||||
"AND moz_places.id=moz_keywords.place_id "
|
"AND moz_places.id=moz_keywords.place_id "
|
||||||
"AND moz_places.url NOT LIKE '%!%s%' ESCAPE '!';"
|
"AND moz_places.url NOT LIKE '%!%s%' ESCAPE '!';"
|
||||||
), # Bookmarks with keywords assigned but no %s substitution
|
), # Bookmarks with keywords assigned but no %s substitution
|
||||||
'search':
|
'search': (
|
||||||
("SELECT moz_keywords.keyword, "
|
"SELECT moz_keywords.keyword, "
|
||||||
" moz_bookmarks.title, "
|
" moz_bookmarks.title, "
|
||||||
" search_conv(moz_places.url) AS url "
|
" search_conv(moz_places.url) AS url "
|
||||||
"FROM moz_keywords,moz_places,moz_bookmarks "
|
"FROM moz_keywords,moz_places,moz_bookmarks "
|
||||||
|
@ -357,9 +357,10 @@ class QuteProc(testprocess.Process):
|
|||||||
if not self._load_ready:
|
if not self._load_ready:
|
||||||
log_line.waited_for = True
|
log_line.waited_for = True
|
||||||
self._is_ready('load')
|
self._is_ready('load')
|
||||||
elif log_line.category == 'misc' and any(testutils.pattern_match(
|
elif (log_line.category == 'misc' and any(
|
||||||
pattern=pattern, value=log_line.message) for pattern in
|
testutils.pattern_match(pattern=pattern,
|
||||||
start_okay_messages_focus):
|
value=log_line.message)
|
||||||
|
for pattern in start_okay_messages_focus)):
|
||||||
self._is_ready('focus')
|
self._is_ready('focus')
|
||||||
elif (log_line.category == 'init' and
|
elif (log_line.category == 'init' and
|
||||||
log_line.module == 'standarddir' and
|
log_line.module == 'standarddir' and
|
||||||
|
@ -241,8 +241,8 @@ def test_log_line_parse(data, attrs):
|
|||||||
pytest.param(
|
pytest.param(
|
||||||
{'created': 86400, 'msecs': 0, 'levelname': 'DEBUG', 'name': 'foo',
|
{'created': 86400, 'msecs': 0, 'levelname': 'DEBUG', 'name': 'foo',
|
||||||
'module': 'bar', 'funcName': 'qux', 'lineno': 10, 'levelno': 10,
|
'module': 'bar', 'funcName': 'qux', 'lineno': 10, 'levelno': 10,
|
||||||
'message': 'quux', 'traceback': 'Traceback (most recent call '
|
'message': 'quux', 'traceback': ('Traceback (most recent call '
|
||||||
'last):\n here be dragons'},
|
'last):\n here be dragons')},
|
||||||
False, False,
|
False, False,
|
||||||
'{timestamp} DEBUG foo bar:qux:10 quux\n'
|
'{timestamp} DEBUG foo bar:qux:10 quux\n'
|
||||||
'Traceback (most recent call last):\n'
|
'Traceback (most recent call last):\n'
|
||||||
|
@ -31,7 +31,8 @@ from qutebrowser.utils import qtutils
|
|||||||
from qutebrowser.commands import cmdexc
|
from qutebrowser.commands import cmdexc
|
||||||
|
|
||||||
|
|
||||||
@hypothesis.given(strategies.lists(min_size=0, max_size=3,
|
@hypothesis.given(strategies.lists(
|
||||||
|
min_size=0, max_size=3,
|
||||||
elements=strategies.integers(min_value=0, max_value=2**31)))
|
elements=strategies.integers(min_value=0, max_value=2**31)))
|
||||||
def test_first_last_item(counts):
|
def test_first_last_item(counts):
|
||||||
"""Test that first() and last() index to the first and last items."""
|
"""Test that first() and last() index to the first and last items."""
|
||||||
|
@ -170,8 +170,9 @@ def test_completion_item_focus_fetch(completionview, qtbot):
|
|||||||
emitted.
|
emitted.
|
||||||
"""
|
"""
|
||||||
model = completionmodel.CompletionModel()
|
model = completionmodel.CompletionModel()
|
||||||
cat = mock.Mock(spec=['layoutChanged', 'layoutAboutToBeChanged',
|
cat = mock.Mock(spec=[
|
||||||
'canFetchMore', 'fetchMore', 'rowCount', 'index', 'data'])
|
'layoutChanged', 'layoutAboutToBeChanged', 'canFetchMore',
|
||||||
|
'fetchMore', 'rowCount', 'index', 'data'])
|
||||||
cat.canFetchMore = lambda *_: True
|
cat.canFetchMore = lambda *_: True
|
||||||
cat.rowCount = lambda *_: 2
|
cat.rowCount = lambda *_: 2
|
||||||
cat.fetchMore = mock.Mock()
|
cat.fetchMore = mock.Mock()
|
||||||
|
@ -642,9 +642,9 @@ def test_setting_option_completion(qtmodeltester, config_stub,
|
|||||||
_check_completions(model, {
|
_check_completions(model, {
|
||||||
"Options": [
|
"Options": [
|
||||||
('aliases', 'Aliases for commands.', '{"q": "quit"}'),
|
('aliases', 'Aliases for commands.', '{"q": "quit"}'),
|
||||||
('bindings.commands', 'Default keybindings',
|
('bindings.commands', 'Default keybindings', (
|
||||||
'{"normal": {"<ctrl+q>": "quit", "ZQ": "quit", '
|
'{"normal": {"<ctrl+q>": "quit", "ZQ": "quit", '
|
||||||
'"I": "invalid", "d": "scroll down"}}'),
|
'"I": "invalid", "d": "scroll down"}}')),
|
||||||
('bindings.default', 'Default keybindings',
|
('bindings.default', 'Default keybindings',
|
||||||
'{"normal": {"<ctrl+q>": "quit", "d": "tab-close"}}'),
|
'{"normal": {"<ctrl+q>": "quit", "d": "tab-close"}}'),
|
||||||
]
|
]
|
||||||
|
@ -318,7 +318,8 @@ class TestConfigPyModules:
|
|||||||
sys.path = old_path
|
sys.path = old_path
|
||||||
|
|
||||||
def test_bind_in_module(self, confpy, qbmodulepy, tmpdir):
|
def test_bind_in_module(self, confpy, qbmodulepy, tmpdir):
|
||||||
qbmodulepy.write('def run(config):',
|
qbmodulepy.write(
|
||||||
|
'def run(config):',
|
||||||
' config.bind(",a", "message-info foo", mode="normal")')
|
' config.bind(",a", "message-info foo", mode="normal")')
|
||||||
confpy.write_qbmodule()
|
confpy.write_qbmodule()
|
||||||
confpy.read()
|
confpy.read()
|
||||||
|
@ -27,28 +27,22 @@ _samples = 'tests/unit/scripts/importer_sample'
|
|||||||
|
|
||||||
def qm_expected(input_format):
|
def qm_expected(input_format):
|
||||||
"""Read expected quickmark-formatted output."""
|
"""Read expected quickmark-formatted output."""
|
||||||
with open(
|
with open(os.path.join(_samples, input_format, 'quickmarks'),
|
||||||
os.path.join(_samples, input_format, 'quickmarks'),
|
'r', encoding='utf-8') as f:
|
||||||
'r',
|
|
||||||
encoding='utf-8') as f:
|
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
def bm_expected(input_format):
|
def bm_expected(input_format):
|
||||||
"""Read expected bookmark-formatted output."""
|
"""Read expected bookmark-formatted output."""
|
||||||
with open(
|
with open(os.path.join(_samples, input_format, 'bookmarks'),
|
||||||
os.path.join(_samples, input_format, 'bookmarks'),
|
'r', encoding='utf-8') as f:
|
||||||
'r',
|
|
||||||
encoding='utf-8') as f:
|
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
def search_expected(input_format):
|
def search_expected(input_format):
|
||||||
"""Read expected search-formatted (config.py) output."""
|
"""Read expected search-formatted (config.py) output."""
|
||||||
with open(
|
with open(os.path.join(_samples, input_format, 'config_py'),
|
||||||
os.path.join(_samples, input_format, 'config_py'),
|
'r', encoding='utf-8') as f:
|
||||||
'r',
|
|
||||||
encoding='utf-8') as f:
|
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
"""Tests for qutebrowser.utils.qtutils."""
|
"""Tests for qutebrowser.utils.qtutils."""
|
||||||
|
|
||||||
import io
|
import io
|
||||||
@ -40,6 +41,7 @@ from qutebrowser.utils import qtutils, utils
|
|||||||
import overflow_test_cases
|
import overflow_test_cases
|
||||||
|
|
||||||
|
|
||||||
|
# pylint: disable=bad-continuation
|
||||||
@pytest.mark.parametrize(['qversion', 'compiled', 'pyqt', 'version', 'exact',
|
@pytest.mark.parametrize(['qversion', 'compiled', 'pyqt', 'version', 'exact',
|
||||||
'expected'], [
|
'expected'], [
|
||||||
# equal versions
|
# equal versions
|
||||||
@ -61,6 +63,7 @@ import overflow_test_cases
|
|||||||
# all up-to-date
|
# all up-to-date
|
||||||
('5.4.0', '5.4.0', '5.4.0', '5.4.0', False, True),
|
('5.4.0', '5.4.0', '5.4.0', '5.4.0', False, True),
|
||||||
])
|
])
|
||||||
|
# pylint: enable=bad-continuation
|
||||||
def test_version_check(monkeypatch, qversion, compiled, pyqt, version, exact,
|
def test_version_check(monkeypatch, qversion, compiled, pyqt, version, exact,
|
||||||
expected):
|
expected):
|
||||||
"""Test for version_check().
|
"""Test for version_check().
|
||||||
|
@ -492,16 +492,12 @@ def test_filename_from_url(qurl, output):
|
|||||||
(QUrl('qute://'), None),
|
(QUrl('qute://'), None),
|
||||||
(QUrl('qute://foobar'), None),
|
(QUrl('qute://foobar'), None),
|
||||||
(QUrl('mailto:nobody'), None),
|
(QUrl('mailto:nobody'), None),
|
||||||
(QUrl('ftp://example.com/'),
|
(QUrl('ftp://example.com/'), ('ftp', 'example.com', 21)),
|
||||||
('ftp', 'example.com', 21)),
|
(QUrl('ftp://example.com:2121/'), ('ftp', 'example.com', 2121)),
|
||||||
(QUrl('ftp://example.com:2121/'),
|
|
||||||
('ftp', 'example.com', 2121)),
|
|
||||||
(QUrl('http://qutebrowser.org:8010/waterfall'),
|
(QUrl('http://qutebrowser.org:8010/waterfall'),
|
||||||
('http', 'qutebrowser.org', 8010)),
|
('http', 'qutebrowser.org', 8010)),
|
||||||
(QUrl('https://example.com/'),
|
(QUrl('https://example.com/'), ('https', 'example.com', 443)),
|
||||||
('https', 'example.com', 443)),
|
(QUrl('https://example.com:4343/'), ('https', 'example.com', 4343)),
|
||||||
(QUrl('https://example.com:4343/'),
|
|
||||||
('https', 'example.com', 4343)),
|
|
||||||
(QUrl('http://user:password@qutebrowser.org/foo?bar=baz#fish'),
|
(QUrl('http://user:password@qutebrowser.org/foo?bar=baz#fish'),
|
||||||
('http', 'qutebrowser.org', 80)),
|
('http', 'qutebrowser.org', 80)),
|
||||||
])
|
])
|
||||||
|
@ -467,12 +467,12 @@ def test_path_info(monkeypatch, equal):
|
|||||||
equal: Whether system data / data and system config / config are equal.
|
equal: Whether system data / data and system config / config are equal.
|
||||||
"""
|
"""
|
||||||
patches = {
|
patches = {
|
||||||
'config': lambda auto=False:
|
'config': lambda auto=False: (
|
||||||
'AUTO CONFIG PATH' if auto and not equal
|
'AUTO CONFIG PATH' if auto and not equal
|
||||||
else 'CONFIG PATH',
|
else 'CONFIG PATH'),
|
||||||
'data': lambda system=False:
|
'data': lambda system=False: (
|
||||||
'SYSTEM DATA PATH' if system and not equal
|
'SYSTEM DATA PATH' if system and not equal
|
||||||
else 'DATA PATH',
|
else 'DATA PATH'),
|
||||||
'cache': lambda: 'CACHE PATH',
|
'cache': lambda: 'CACHE PATH',
|
||||||
'runtime': lambda: 'RUNTIME PATH',
|
'runtime': lambda: 'RUNTIME PATH',
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user