Skip to content

Commit

Permalink
Clean up temp directory in test tear down
Browse files Browse the repository at this point in the history
testPKNotInt was failing on Windows because the file was still open

(cherry picked from commit 08065c3)
  • Loading branch information
audun authored and nyalldawson committed Jun 2, 2020
1 parent 3f2fb5a commit ee0e5e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/src/python/test_provider_spatialite.py
Expand Up @@ -964,7 +964,9 @@ def testEncodeUri(self):
def testPKNotInt(self):
""" Check when primary key is not an integer """
# create test db
dbname = os.path.join(tempfile.mkdtemp(), "test_pknotint.sqlite")
tmpdir = tempfile.mkdtemp()
self.dirs_to_cleanup.append(tmpdir)
dbname = os.path.join(tmpdir, "test_pknotint.sqlite")
con = spatialite_connect(dbname, isolation_level=None)
cur = con.cursor()

Expand Down Expand Up @@ -1010,8 +1012,6 @@ def testPKNotInt(self):

con.close()

basepath, filename = os.path.split(dbname)
shutil.rmtree(basepath)

def testLoadStyle(self):
"""Check that we can store and load a style"""
Expand Down

0 comments on commit ee0e5e9

Please sign in to comment.