Add test for utils.libgl_workaround()
This commit is contained in:
parent
fb6594be27
commit
46efdb736f
|
|
@ -789,5 +789,5 @@ def libgl_workaround() -> None:
|
|||
return
|
||||
|
||||
libgl = ctypes.util.find_library("GL")
|
||||
if libgl is not None:
|
||||
if libgl is not None: # pragma: no branch
|
||||
ctypes.CDLL(libgl, mode=ctypes.RTLD_GLOBAL)
|
||||
|
|
|
|||
|
|
@ -885,3 +885,10 @@ def test_ceil_log_invalid(number, base):
|
|||
math.log(number, base)
|
||||
with pytest.raises(ValueError):
|
||||
utils.ceil_log(number, base)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('skip', [True, False])
|
||||
def test_libgl_workaround(monkeypatch, skip):
|
||||
if skip:
|
||||
monkeypatch.setenv('QUTE_SKIP_LIBGL_WORKAROUND', '1')
|
||||
utils.libgl_workaround() # Just make sure it doesn't crash.
|
||||
|
|
|
|||
Loading…
Reference in New Issue