浏览代码

Some QOL on the model tests

Getty Ritter 5 年之前
父节点
当前提交
26b507c348
共有 1 个文件被更改,包括 3 次插入4 次删除
  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()