Use importorskip to skip stylesheet tests on webkit only systems
This commit is contained in:
parent
28572ce3b1
commit
92a6e61b52
@ -22,11 +22,8 @@
|
|||||||
import os
|
import os
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
try:
|
QtWebEngineWidgets = pytest.importorskip("PyQt5.QtWebEngineWidgets")
|
||||||
from PyQt5.QtWebEngineWidgets import QWebEngineProfile
|
QWebEngineProfile = QtWebEngineWidgets.QWebEngineProfile
|
||||||
except ImportError:
|
|
||||||
QWebEngineProfile = None
|
|
||||||
|
|
||||||
|
|
||||||
from qutebrowser.utils import javascript
|
from qutebrowser.utils import javascript
|
||||||
|
|
||||||
@ -59,8 +56,6 @@ class StylesheetTester:
|
|||||||
"""Initialize the stylesheet with a provided css file."""
|
"""Initialize the stylesheet with a provided css file."""
|
||||||
css_path = os.path.join(os.path.dirname(__file__), css_file)
|
css_path = os.path.join(os.path.dirname(__file__), css_file)
|
||||||
self.config_stub.val.content.user_stylesheets = css_path
|
self.config_stub.val.content.user_stylesheets = css_path
|
||||||
if QWebEngineProfile is None:
|
|
||||||
pytest.skip("QTWebEngine not found.")
|
|
||||||
p = QWebEngineProfile.defaultProfile()
|
p = QWebEngineProfile.defaultProfile()
|
||||||
webenginesettings._init_stylesheet(p)
|
webenginesettings._init_stylesheet(p)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user