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
This commit is contained in:
parent
22f2d04ded
commit
5c1bb190f7
@ -24,6 +24,8 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
import warnings
|
||||||
|
import ctypes
|
||||||
|
import ctypes.util
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import hypothesis
|
import hypothesis
|
||||||
@ -236,6 +238,14 @@ def set_backend(monkeypatch, request):
|
|||||||
monkeypatch.setattr(objects, 'backend', backend)
|
monkeypatch.setattr(objects, 'backend', backend)
|
||||||
|
|
||||||
|
|
||||||
|
@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)
|
@pytest.fixture(autouse=True)
|
||||||
def apply_fake_os(monkeypatch, request):
|
def apply_fake_os(monkeypatch, request):
|
||||||
fake_os = request.node.get_closest_marker('fake_os')
|
fake_os = request.node.get_closest_marker('fake_os')
|
||||||
|
Loading…
Reference in New Issue
Block a user