summaryrefslogtreecommitdiff
path: root/tests/helpers/fixtures.py
diff options
context:
space:
mode:
authorJimmy <jimmy@spalge.com>2019-06-03 13:49:02 +1200
committerJimmy <jimmy@spalge.com>2019-06-03 13:49:02 +1200
commit62244a8fbb405b2d19720ad2a4c5cb1e2f137a9c (patch)
treeacc7ed93c9cc572d295666548514ae4d9362e1db /tests/helpers/fixtures.py
parentb2b4e437d4d0d3a52a3e46c3c640b6a4f8465935 (diff)
downloadqutebrowser-62244a8fbb405b2d19720ad2a4c5cb1e2f137a9c.tar.gz
qutebrowser-62244a8fbb405b2d19720ad2a4c5cb1e2f137a9c.zip
Disable error pages in webpage fixture.
Due to a [change][] in webkit that introduced a default error page the the webkit/test_tabhistory.py::test_titles broke with the active tab because network access is disable in the webpage fixture. This change disables the default error pages in the fixture by telling the error notify thing that it doesn't support doing anything with the errors. It also disables the `ChooseMultipleFilesExtension` which should be used with this fixture since we override that for real in qutebrowser I'm declaring the class inside the method because I don't know how to skip declaring a class in stubs.py with importskip. change: https://github.com/annulen/webkit/commit/3b3724183bbe
Diffstat (limited to 'tests/helpers/fixtures.py')
-rw-r--r--tests/helpers/fixtures.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py
index e50220c51..10fc4702f 100644
--- a/tests/helpers/fixtures.py
+++ b/tests/helpers/fixtures.py
@@ -428,7 +428,15 @@ def webengineview(qtbot, monkeypatch, web_tab_setup):
def webpage(qnam):
"""Get a new QWebPage object."""
QtWebKitWidgets = pytest.importorskip('PyQt5.QtWebKitWidgets')
- page = QtWebKitWidgets.QWebPage()
+ class WebPageStub(QtWebKitWidgets.QWebPage):
+
+ """QWebPage with default error pages disabled."""
+
+ def supportsExtension(self, _ext):
+ """No extensions needed."""
+ return False
+
+ page = WebPageStub()
page.networkAccessManager().deleteLater()
page.setNetworkAccessManager(qnam)
return page