@pytest.fixture
def db(maildir):
- with dbmod.Database.create(maildir.path) as db:
+ with dbmod.Database.create(maildir.path, config=notmuch2.Database.CONFIG.EMPTY) as db:
yield db
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):
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:
maildir.deliver(body='baz',
headers=[('In-Reply-To', '<{}>'.format(msgid))])
notmuch('new')
- with dbmod.Database(maildir.path, 'rw') as db:
+ with dbmod.Database(maildir.path, 'rw', config=notmuch2.Database.CONFIG.EMPTY) as db:
yield db
def test_count_messages(self, db):