Skip HTML annotation tests if not built with webkit

This commit is contained in:
Nyall Dawson 2025-08-27 14:41:51 +10:00
parent 9c2c2d86a5
commit 3f48e04345

View File

@ -239,6 +239,7 @@ class TestQgsAnnotation(QgisTestCase):
a.setFilePath(svg)
self.assertTrue(self.renderAnnotationInLayout("svg_annotation_in_layout", a))
@unittest.skipIf(not Qgis.hasQtWebkit(), "QtWebkit not available")
def testHtmlAnnotation(self):
"""test rendering a html annotation"""
a = QgsHtmlAnnotation()
@ -256,6 +257,7 @@ class TestQgsAnnotation(QgisTestCase):
im = self.renderAnnotation(clone, QPointF(20, 30))
self.assertTrue(self.image_check("html_annotation", "html_annotation", im))
@unittest.skipIf(not Qgis.hasQtWebkit(), "QtWebkit not available")
def testHtmlAnnotationSetHtmlSource(self):
"""test rendering html annotation where the html is set directly (not from file)"""
a = QgsHtmlAnnotation()
@ -271,6 +273,7 @@ class TestQgsAnnotation(QgisTestCase):
self.image_check("html_annotation_html_source", "html_annotation", im)
)
@unittest.skipIf(not Qgis.hasQtWebkit(), "QtWebkit not available")
def testHtmlAnnotationInLayout(self):
"""test rendering a svg annotation"""
a = QgsHtmlAnnotation()
@ -282,6 +285,7 @@ class TestQgsAnnotation(QgisTestCase):
a.setSourceFile(html)
self.assertTrue(self.renderAnnotationInLayout("html_annotation_in_layout", a))
@unittest.skipIf(not Qgis.hasQtWebkit(), "QtWebkit not available")
def testHtmlAnnotationWithFeature(self):
"""test rendering a html annotation with a feature"""
layer = QgsVectorLayer(
@ -346,6 +350,7 @@ class TestQgsAnnotation(QgisTestCase):
im = self.renderAnnotation(a, QPointF(20, 30))
self.assertTrue(self.image_check("relative_style", "relative_style", im))
@unittest.skipIf(not Qgis.hasQtWebkit(), "QtWebkit not available")
def testMargins(self):
"""test rendering an annotation with margins"""
a = QgsHtmlAnnotation()