(request, tmp_path: Path)
| 11 | |
| 12 | @pytest.fixture(params=['memory', 'json']) |
| 13 | def 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 |
nothing calls this directly
no test coverage detected