Browse Source

Some QOL on the model tests

Getty Ritter 4 years ago
parent
commit
26b507c348
1 changed files with 3 additions and 4 deletions
  1. 3 4
      tests/model.py

+ 3 - 4
tests/model.py

@@ -1,6 +1,5 @@
 import lc.config as c
 import lc.model as m
-import tempfile
 
 
 class TestDB:
@@ -8,6 +7,9 @@ class TestDB:
         c.DB.init(":memory:")
         c.DB.create_tables(m.MODELS)
 
+    def teardown_method(self, _):
+        c.DB.close()
+
     def test_create_user(self):
         name = "gdritter"
         u = m.User.create(name=name)
@@ -63,6 +65,3 @@ class TestDB:
         # one already entered
         assert t.id == m.Tag.get(name="food/bread/rye").id
         assert t2.id == m.Tag.get(name="food/bread/baguette").id
-
-    def teardown_method(self, _):
-        c.DB.close()