Navigation Menu

Skip to content

Commit

Permalink
Ensure file is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Apr 26, 2023
1 parent c8ae430 commit 4b15675
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/src/python/test_qgsannotation.py
Expand Up @@ -135,8 +135,8 @@ def testHtmlAnnotationSetHtmlSource(self):
a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0))
a.setFrameSizeMm(QSizeF(400 / 3.7795275, 250 / 3.7795275))
a.setFrameOffsetFromReferencePointMm(QPointF(70 / 3.7795275, 90 / 3.7795275))
htmlFile = open(TEST_DATA_DIR + "/test_html.html")
htmlText = htmlFile.read()
with open(TEST_DATA_DIR + "/test_html.html") as f:
htmlText = f.read()
a.setHtmlSource(htmlText)
im = self.renderAnnotation(a, QPointF(20, 30))
self.assertTrue(self.imageCheck('html_annotation_html_source', 'html_annotation', im))
Expand Down

0 comments on commit 4b15675

Please sign in to comment.