From 3f48e0434596e0502b35fef22fab73f304b2772e Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Wed, 27 Aug 2025 14:41:51 +1000 Subject: [PATCH] Skip HTML annotation tests if not built with webkit --- tests/src/python/test_qgsannotation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/src/python/test_qgsannotation.py b/tests/src/python/test_qgsannotation.py index 3d82164fc53..e3ddb99d396 100644 --- a/tests/src/python/test_qgsannotation.py +++ b/tests/src/python/test_qgsannotation.py @@ -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()