Test: Use temporary directory to test bsddb

This commit is contained in:
André Apitzsch 2022-03-09 19:31:00 +01:00 committed by Nick Hall
parent 21e94dec99
commit c5564bcd19

View File

@ -20,18 +20,11 @@
# test/LosHawlos_bsddbtest.py
from bsddb3 import dbshelve, db
import os
import sys
sys.path.append('../gramps')
import gramps.gen.const as const
import tempfile
from bsddb3 import db
print("Test that db.DBEnv().open() works")
env_name = os.path.expanduser(os.path.join(const.HOME_DIR, "test"))
if not os.path.isdir(env_name):
os.mkdir(env_name)
with tempfile.TemporaryDirectory() as env_name:
env = db.DBEnv()
env.set_cachesize(0,0x2000000)
env.set_lk_max_locks(25000)