示例#1
0
 def create_store():
     path = tempfile.mktemp(suffix='.lmdb')
     atexit_rmtree(path)
     try:
         store = LMDBStore(path)
     except ImportError:  # pragma: no cover
         raise SkipTest('lmdb nod installed')
     return store, None
示例#2
0
 def create_array(read_only=False, **kwargs):
     path = mktemp(suffix='.lmdb')
     atexit_rmtree(path)
     try:
         store = LMDBStore(path, buffers=False)
     except ImportError:  # pragma: no cover
         raise SkipTest('lmdb not installed')
     kwargs.setdefault('compressor', Zlib(1))
     init_array(store, **kwargs)
     return Array(store, read_only=read_only)
示例#3
0
 def create_store(self):
     path = tempfile.mktemp(suffix='.lmdb')
     atexit.register(atexit_rmtree, path)
     if PY2:  # pragma: py3 no cover
         # don't use buffers, otherwise would have to rewrite tests as bytes and
         # buffer don't compare equal in PY2
         buffers = False
     else:  # pragma: py2 no cover
         buffers = True
     store = LMDBStore(path, buffers=buffers)
     return store
示例#4
0
 def create_store(self):
     path = tempfile.mktemp(suffix='.lmdb')
     atexit_rmtree(path)
     if PY2:  # pragma: py3 no cover
         # don't use buffers, otherwise would have to rewrite tests as bytes and
         # buffer don't compare equal in PY2
         buffers = False
     else:  # pragma: py2 no cover
         buffers = True
     try:
         store = LMDBStore(path, buffers=buffers)
     except ImportError:  # pragma: no cover
         raise SkipTest('lmdb not installed')
     return store
示例#5
0
 def create_store():
     path = tempfile.mktemp(suffix='.lmdb')
     atexit.register(atexit_rmtree, path)
     store = LMDBStore(path)
     return store, None
示例#6
0
 def create_store():
     pytest.importorskip("lmdb")
     path = tempfile.mktemp(suffix='.lmdb')
     atexit.register(atexit_rmtree, path)
     store = LMDBStore(path)
     return store, None