Skip to content

Commit

Permalink
Close file after write
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 7, 2017
1 parent 379b5ed commit 8915936
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/src/python/test_provider_spatialite.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ def test_invalid_iterator(self):
shutil.copy(self.dbname, corrupt_dbname)
layer = QgsVectorLayer("dbname=%s table=test_pg (geometry)" % corrupt_dbname, "test_pg", "spatialite")
# Corrupt the database
open(corrupt_dbname, 'wb').write(b'')
with open(corrupt_dbname, 'wb') as f:
f.write(b'')
layer.getFeatures()
layer = None
os.unlink(corrupt_dbname)
Expand Down

0 comments on commit 8915936

Please sign in to comment.