MCPcopy
hub / github.com/msiemens/tinydb / db

Function db

tests/conftest.py:13–22  ·  view source on GitHub ↗
(request, tmp_path: Path)

Source from the content-addressed store, hash-verified

11
12@pytest.fixture(params=['memory', 'json'])
13def db(request, tmp_path: Path):
14 if request.param == 'json':
15 db_ = TinyDB(tmp_path / 'test.db', storage=JSONStorage)
16 else:
17 db_ = TinyDB(storage=MemoryStorage)
18
19 db_.drop_tables()
20 db_.insert_multiple({'int': 1, 'char': c} for c in 'abc')
21
22 yield db_
23
24
25@pytest.fixture

Callers

nothing calls this directly

Calls 3

drop_tablesMethod · 0.95
TinyDBClass · 0.90
insert_multipleMethod · 0.80

Tested by

no test coverage detected