summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2019-03-18 13:23:42 +0100
committerFlorian Bruhin <me@the-compiler.org>2019-03-18 13:25:00 +0100
commit309d78ad04369b0de2d731d5e2ef8b1ba6259645 (patch)
tree533088448345432e0c1cd4af4f776216453aadcd
parentd303b9652f1397e9fe9e1b0134c9373e73d07a9f (diff)
downloadqutebrowser-309d78ad04369b0de2d731d5e2ef8b1ba6259645.tar.gz
qutebrowser-309d78ad04369b0de2d731d5e2ef8b1ba6259645.zip
Use web_tab_setup in webengineview fixture
This reverts 621dab5b0428a9042418c8ceabaffa49badd4573 which caused all tests to depend on a QApplication. This way, we make sure to initialize testdata_scheme early enough when the webengineview fixture is used.
-rw-r--r--tests/helpers/fixtures.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py
index f762ab110..e50220c51 100644
--- a/tests/helpers/fixtures.py
+++ b/tests/helpers/fixtures.py
@@ -165,7 +165,7 @@ def greasemonkey_manager(data_tmpdir):
objreg.delete('greasemonkey')
-@pytest.fixture(scope='session', autouse=True)
+@pytest.fixture(scope='session')
def testdata_scheme(qapp):
try:
global _qute_scheme_handler
@@ -192,7 +192,8 @@ def testdata_scheme(qapp):
@pytest.fixture
def web_tab_setup(qtbot, tab_registry, session_manager_stub,
- greasemonkey_manager, fake_args, config_stub):
+ greasemonkey_manager, fake_args, config_stub,
+ testdata_scheme):
"""Shared setup for webkit_tab/webengine_tab."""
# Make sure error logging via JS fails tests
config_stub.val.content.javascript.log = {
@@ -414,7 +415,7 @@ def qnam(qapp):
@pytest.fixture
-def webengineview(qtbot, monkeypatch):
+def webengineview(qtbot, monkeypatch, web_tab_setup):
"""Get a QWebEngineView if QtWebEngine is available."""
QtWebEngineWidgets = pytest.importorskip('PyQt5.QtWebEngineWidgets')
monkeypatch.setattr(objects, 'backend', usertypes.Backend.QtWebEngine)