-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathconftest.py
More file actions
35 lines (26 loc) · 817 Bytes
/
conftest.py
File metadata and controls
35 lines (26 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from typing import Tuple
import pytest
import pyfdb
import tests.util as util
from pyfdb.pyfdb import FDB
@pytest.fixture
def setup_fdb_tmp_dir(tmp_path_factory) -> Tuple[str, FDB]:
def create_randomized_fdb_path():
tests_dir = util.get_test_data_root()
tmp_dir = tmp_path_factory.mktemp("root")
config = dict(
type="local",
engine="toc",
schema=str(tests_dir / "default_fdb_schema"),
spaces=[
dict(
handler="Default",
roots=[
{"path": str(tmp_dir)},
],
)
],
)
return str(tmp_dir), pyfdb.FDB(config)
# Return a function to randomize on each call
return create_randomized_fdb_path