diff --git a/pytest.ini b/pytest.ini index edc0b2d8f..4fefa0f77 100644 --- a/pytest.ini +++ b/pytest.ini @@ -51,7 +51,8 @@ qt_log_ignore = ^Error when parsing the netrc file ^Image of format '' blocked because it is not considered safe. If you are sure it is safe to do so, you can white-list the format by setting the environment variable QTWEBKIT_IMAGEFORMAT_WHITELIST= ^QPainter::end: Painter ended with \d+ saved states - ^QSslSocket: cannot resolve * + ^QSslSocket: cannot resolve .* + ^QSslSocket: cannot call unresolved function .* ^Incompatible version of OpenSSL ^QQuickWidget::invalidateRenderControl could not make context current ^libpng warning: iCCP: known incorrect sRGB profile diff --git a/tests/conftest.py b/tests/conftest.py index da0bded55..209cb5898 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -28,7 +28,7 @@ import warnings import sip import pytest import hypothesis -from PyQt5.QtCore import PYQT_VERSION +from PyQt5.QtCore import qVersion, PYQT_VERSION pytest.register_assert_rewrite('helpers') @@ -151,6 +151,17 @@ def pytest_ignore_collect(path): return rel_path == os.path.join('end2end', 'features') and skip_bdd +@pytest.fixture(scope='session') +def qapp_args(): + """Make QtWebEngine unit tests run on Qt 5.7.1. + + See https://github.com/qutebrowser/qutebrowser/issues/3163 + """ + if qVersion() == '5.7.1': + return [sys.argv[0], '--disable-seccomp-filter-sandbox'] + return [] + + @pytest.fixture(scope='session') def qapp(qapp): """Change the name of the QApplication instance."""