mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-17 23:09:35 +00:00
25 lines
572 B
Python
25 lines
572 B
Python
import asyncio
|
|
import os
|
|
|
|
# JWT-based API tests require this gate to be off (production may set .env).
|
|
os.environ["DEALIX_INTERNAL_API_TOKEN"] = ""
|
|
|
|
import pytest
|
|
import pytest_asyncio
|
|
from httpx import AsyncClient, ASGITransport
|
|
from app.main import app
|
|
|
|
|
|
@pytest.fixture(scope="session", autouse=True)
|
|
def _init_database():
|
|
from app.database import init_db
|
|
|
|
asyncio.run(init_db())
|
|
|
|
|
|
@pytest_asyncio.fixture
|
|
async def client():
|
|
transport = ASGITransport(app=app)
|
|
async with AsyncClient(transport=transport, base_url="http://test") as ac:
|
|
yield ac
|