diff options
author | Florian Bruhin <me@the-compiler.org> | 2018-10-06 19:52:59 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2018-10-06 19:52:59 +0200 |
commit | 5c1bb190f7919d10c989494b718adca11a10ed37 (patch) | |
tree | f479fc9655ec7378374e946e606fb7d4ed587e06 /tests/conftest.py | |
parent | 22f2d04ded9bf1fe099053a76459e36a32b9530b (diff) | |
download | qutebrowser-5c1bb190f7919d10c989494b718adca11a10ed37.tar.gz qutebrowser-5c1bb190f7919d10c989494b718adca11a10ed37.zip |
tests: Apply libGL workaround
This probably fixes the tests for nvidia users:
https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/941826
but also fixes issues on Qt 5.12:
https://bugreports.qt.io/browse/QTBUG-70696
Fixes #4243
Diffstat (limited to 'tests/conftest.py')
-rw-r--r-- | tests/conftest.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 05564f370..7bf67fdae 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -24,6 +24,8 @@ import os import sys import warnings +import ctypes +import ctypes.util import pytest import hypothesis @@ -237,6 +239,14 @@ def set_backend(monkeypatch, request): @pytest.fixture(autouse=True) +def apply_libgl_workaround(): + """Make sure we load libGL early so QtWebEngine tests run properly.""" + libgl = ctypes.util.find_library("GL") + if libgl is not None: + ctypes.CDLL(libgl, mode=ctypes.RTLD_GLOBAL) + + +@pytest.fixture(autouse=True) def apply_fake_os(monkeypatch, request): fake_os = request.node.get_closest_marker('fake_os') if not fake_os: |