]> git.notmuchmail.org Git - notmuch/blobdiff - bindings/python-cffi/tests/test_database.py
Merge tag '0.31.4'
[notmuch] / bindings / python-cffi / tests / test_database.py
index 55069b5e35df85bb0739a1a0d865302c6693af32..9b3219c00e634a9e4d91fa6d3c7c329dd8e59aa2 100644 (file)
@@ -80,7 +80,7 @@ class TestCreate:
             db.create(tmppath)
 
     def test_create_existing(self, tmppath, db):
-        with pytest.raises(errors.FileError):
+        with pytest.raises(errors.DatabaseExistsError):
             dbmod.Database.create(path=tmppath)
 
     def test_close(self, db):
@@ -127,6 +127,11 @@ class TestAtomic:
         with pytest.raises(errors.UnbalancedAtomicError):
             ctx.force_end()
 
+    def test_abort(self, db):
+        with db.atomic() as txn:
+            txn.abort()
+        assert db.closed
+
 
 class TestRevision: