From 5978605873dfaf4aeb88367f6aaed85669479611 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 8 Sep 2018 13:22:17 +0200 Subject: [PATCH] Make caret unittests run with QtWebKit --- tests/helpers/fixtures.py | 3 ++- tests/helpers/stubs.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py index 9ee2d2bd5..1c37301cf 100644 --- a/tests/helpers/fixtures.py +++ b/tests/helpers/fixtures.py @@ -154,7 +154,8 @@ def greasemonkey_manager(data_tmpdir): @pytest.fixture def webkit_tab(qtbot, tab_registry, cookiejar_and_cache, mode_manager, - session_manager_stub, greasemonkey_manager, fake_args): + session_manager_stub, greasemonkey_manager, fake_args, + host_blocker_stub): webkittab = pytest.importorskip('qutebrowser.browser.webkit.webkittab') tab = webkittab.WebKitTab(win_id=0, mode_manager=mode_manager, private=False) diff --git a/tests/helpers/stubs.py b/tests/helpers/stubs.py index f10522a02..9af7a6fcc 100644 --- a/tests/helpers/stubs.py +++ b/tests/helpers/stubs.py @@ -475,6 +475,9 @@ class HostBlockerStub: def __init__(self): self.blocked_hosts = set() + def is_blocked(self, url): + return url in self.blocked_hosts + class SessionManagerStub: