Test: Use temporary directory to test bsddb
This commit is contained in:
parent
21e94dec99
commit
c5564bcd19
@ -20,18 +20,11 @@
|
|||||||
|
|
||||||
# test/LosHawlos_bsddbtest.py
|
# test/LosHawlos_bsddbtest.py
|
||||||
|
|
||||||
from bsddb3 import dbshelve, db
|
import tempfile
|
||||||
import os
|
from bsddb3 import db
|
||||||
import sys
|
|
||||||
|
|
||||||
sys.path.append('../gramps')
|
|
||||||
import gramps.gen.const as const
|
|
||||||
|
|
||||||
print("Test that db.DBEnv().open() works")
|
print("Test that db.DBEnv().open() works")
|
||||||
env_name = os.path.expanduser(os.path.join(const.HOME_DIR, "test"))
|
with tempfile.TemporaryDirectory() as env_name:
|
||||||
if not os.path.isdir(env_name):
|
|
||||||
os.mkdir(env_name)
|
|
||||||
|
|
||||||
env = db.DBEnv()
|
env = db.DBEnv()
|
||||||
env.set_cachesize(0,0x2000000)
|
env.set_cachesize(0,0x2000000)
|
||||||
env.set_lk_max_locks(25000)
|
env.set_lk_max_locks(25000)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user