diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2016-03-09 10:09:04 -0800 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2016-03-09 10:09:04 -0800 |
commit | b4c15b9792d15a4ff9a0de92eb63f51cb7b4e6c9 (patch) | |
tree | 086d72dfd7f55428038ab48319480a06177fbc3c /tests/t3_inode_cache.py | |
parent | 487050cd59bbea62e19eb6443f1f0a333e12538f (diff) |
Import s3ql_1.15.orig.tar.bz2
Diffstat (limited to 'tests/t3_inode_cache.py')
-rw-r--r-- | tests/t3_inode_cache.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/t3_inode_cache.py b/tests/t3_inode_cache.py index 5b85e55..e7c53d1 100644 --- a/tests/t3_inode_cache.py +++ b/tests/t3_inode_cache.py @@ -15,11 +15,16 @@ from s3ql.database import Connection import unittest2 as unittest import time import tempfile +import os class cache_tests(unittest.TestCase): def setUp(self): - self.dbfile = tempfile.NamedTemporaryFile() + # Destructors are not guaranteed to run, and we can't unlink + # the file immediately because apsw refers to it by name. + # Therefore, we unlink the file manually in tearDown() + self.dbfile = tempfile.NamedTemporaryFile(delete=False) + self.db = Connection(self.dbfile.name) create_tables(self.db) init_tables(self.db) @@ -27,6 +32,7 @@ class cache_tests(unittest.TestCase): def tearDown(self): self.cache.destroy() + os.unlink(self.dbfile.name) def test_create(self): attrs = {'mode': 784, |