From 19b39a098ae790d044d33f60c8a41104709aaa2e Mon Sep 17 00:00:00 2001 From: Jimmy Date: Mon, 3 Jun 2019 13:49:02 +1200 Subject: 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 --- tests/helpers/fixtures.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-54-g00ecf