summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_collection.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_collection.py b/tests/test_collection.py
index a2c1a87..beab6e0 100644
--- a/tests/test_collection.py
+++ b/tests/test_collection.py
@@ -98,8 +98,11 @@ class testEntries(unittest.TestCase):
def setUp(self):
self.collection = lesana.Collection('tests/data/simple')
self.basepath = 'tests/data/simple/items'
+ self.filenames = []
def tearDown(self):
+ for fname in self.filenames:
+ os.remove(fname)
shutil.rmtree(os.path.join(self.collection.basedir, '.lesana'))
def test_simple(self):
@@ -119,6 +122,7 @@ class testEntries(unittest.TestCase):
new_entry = lesana.Entry(self.collection)
self.collection.save_entries(entries=[new_entry])
entry_fname = 'tests/data/simple/items/' + new_entry.fname
+ self.filenames.append(entry_fname)
with open(entry_fname) as fp:
text = fp.read()
self.assertIn('quantity (integer): how many items are there', text)
@@ -127,7 +131,6 @@ class testEntries(unittest.TestCase):
written = ruamel.yaml.safe_load(text)
self.assertIsInstance(written['quantity'], int)
self.assertIsInstance(written['name'], str)
- os.remove(entry_fname)
def test_entry_representation(self):
uid = '11189ee47ddf4796b718a483b379f976'