We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent c8ae430 commit 4b15675Copy full SHA for 4b15675
tests/src/python/test_qgsannotation.py
@@ -135,8 +135,8 @@ def testHtmlAnnotationSetHtmlSource(self):
135
a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
136
a.setFrameSizeMm(QSizeF(400 / 3.7795275, 250 / 3.7795275))
137
a.setFrameOffsetFromReferencePointMm(QPointF(70 / 3.7795275, 90 / 3.7795275))
138
- htmlFile = open(TEST_DATA_DIR + "/test_html.html")
139
- htmlText = htmlFile.read()
+ with open(TEST_DATA_DIR + "/test_html.html") as f:
+ htmlText = f.read()
140
a.setHtmlSource(htmlText)
141
im = self.renderAnnotation(a, QPointF(20, 30))
142
self.assertTrue(self.imageCheck('html_annotation_html_source', 'html_annotation', im))
0 commit comments