mirror of
https://github.com/enpaul/peewee-plus.git
synced 2025-09-19 01:41:58 +00:00
Add PathField class for storing pathlib objects
Add tests for pathfield class Add database fixture for generating test databases
This commit is contained in:
22
tests/fixtures.py
Normal file
22
tests/fixtures.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import uuid
|
||||
|
||||
import peewee
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
def fakedb(tmp_path):
|
||||
"""Create a temporary pho-database (fakedb) for testing fields"""
|
||||
|
||||
sqlite = peewee.SqliteDatabase(
|
||||
tmp_path / f"{uuid.uuid4()}.db",
|
||||
pragmas={
|
||||
"journal_mode": "wal",
|
||||
"cache_size": -1 * 64000,
|
||||
"foreign_keys": 1,
|
||||
"ignore_check_constraints": 0,
|
||||
"synchronous": 0,
|
||||
},
|
||||
)
|
||||
|
||||
yield sqlite
|
Reference in New Issue
Block a user