This commit is contained in:
Florian Bruhin 2018-09-14 22:49:41 +02:00
parent 5ea8e766f5
commit d74daf9294
4 changed files with 10 additions and 6 deletions

View File

@ -21,12 +21,11 @@
import math import math
import functools import functools
import sys
import re import re
import html as html_utils import html as html_utils
from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Qt, QEvent, QPoint, QPointF, from PyQt5.QtCore import (pyqtSignal, pyqtSlot, Qt, QEvent, QPoint, QPointF,
QUrl, QTimer, QObject, qVersion) QUrl, QTimer, QObject)
from PyQt5.QtGui import QKeyEvent, QIcon from PyQt5.QtGui import QKeyEvent, QIcon
from PyQt5.QtNetwork import QAuthenticator from PyQt5.QtNetwork import QAuthenticator
from PyQt5.QtWidgets import QApplication from PyQt5.QtWidgets import QApplication

View File

@ -52,6 +52,7 @@ def main():
# pytest fixtures # pytest fixtures
'redefined-outer-name', 'redefined-outer-name',
'unused-argument', 'unused-argument',
'too-many-arguments',
# things which are okay in tests # things which are okay in tests
'missing-docstring', 'missing-docstring',
'protected-access', 'protected-access',

View File

@ -52,6 +52,9 @@ from qutebrowser.misc import savemanager, sql, objects
from qutebrowser.keyinput import modeman from qutebrowser.keyinput import modeman
_qute_scheme_handler = None
class WinRegistryHelper: class WinRegistryHelper:
"""Helper class for win_registry.""" """Helper class for win_registry."""
@ -160,13 +163,14 @@ def testdata_scheme(qapp):
global _qute_scheme_handler global _qute_scheme_handler
from qutebrowser.browser.webengine import webenginequtescheme from qutebrowser.browser.webengine import webenginequtescheme
from PyQt5.QtWebEngineWidgets import QWebEngineProfile from PyQt5.QtWebEngineWidgets import QWebEngineProfile
_qute_scheme_handler = webenginequtescheme.QuteSchemeHandler(parent=qapp) _qute_scheme_handler = webenginequtescheme.QuteSchemeHandler(
parent=qapp)
_qute_scheme_handler.install(QWebEngineProfile.defaultProfile()) _qute_scheme_handler.install(QWebEngineProfile.defaultProfile())
except ImportError: except ImportError:
pass pass
@qutescheme.add_handler('testdata') @qutescheme.add_handler('testdata')
def handler(url): def handler(url): # pylint: disable=unused-variable
file_abs = os.path.abspath(os.path.dirname(__file__)) file_abs = os.path.abspath(os.path.dirname(__file__))
filename = os.path.join(file_abs, '..', 'end2end', filename = os.path.join(file_abs, '..', 'end2end',
url.path().lstrip('/')) url.path().lstrip('/'))

View File

@ -19,7 +19,6 @@
"""Tests for caret browsing mode.""" """Tests for caret browsing mode."""
import os.path
import textwrap import textwrap
import pytest import pytest
@ -55,7 +54,8 @@ class Selection:
quickly, we try to read it multiple times. quickly, we try to read it multiple times.
""" """
for _ in range(10): for _ in range(10):
with self._qtbot.wait_signal(self._callback_checker.got_result) as blocker: with self._qtbot.wait_signal(
self._callback_checker.got_result) as blocker:
self._caret.selection(self._callback_checker.callback) self._caret.selection(self._callback_checker.callback)
selection = blocker.args[0] selection = blocker.args[0]