Files
FabledSteward/tests/conftest.py
2026-04-13 17:13:55 -04:00

28 lines
611 B
Python

import pytest
import pytest_asyncio
from pathlib import Path
import textwrap
from roundtable.app import create_app
@pytest.fixture
def config_file(tmp_path):
f = tmp_path / "config.yaml"
f.write_text(textwrap.dedent("""\
secret_key: test-secret-key-32-chars-minimum!!
database:
url: postgresql+asyncpg://test:test@localhost/test
"""))
return f
@pytest_asyncio.fixture
async def app(config_file):
application = create_app(config_path=config_file, testing=True)
return application
@pytest_asyncio.fixture
async def client(app):
return app.test_client()