mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
refactor: httpx transport warning fixed
This commit is contained in:
parent
7e34800d78
commit
85789ee4ad
@ -1,3 +1,5 @@
|
||||
-- DROP DATABASE IF EXISTS devdb;
|
||||
-- CREATE DATABASE devdb;
|
||||
\connect devdb;
|
||||
CREATE SCHEMA shakespeare;
|
||||
CREATE SCHEMA happy_hog;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import pytest
|
||||
from httpx import AsyncClient
|
||||
from httpx import AsyncClient, ASGITransport
|
||||
|
||||
from app.database import engine
|
||||
from app.main import app
|
||||
@ -29,10 +29,16 @@ async def start_db():
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
async def client(start_db) -> AsyncClient:
|
||||
async with AsyncClient(
|
||||
|
||||
transport = ASGITransport(
|
||||
app=app,
|
||||
|
||||
)
|
||||
async with AsyncClient(
|
||||
# app=app,
|
||||
base_url="http://testserver/v1",
|
||||
headers={"Content-Type": "application/json"},
|
||||
transport=transport,
|
||||
) as test_client:
|
||||
app.state.redis = await get_redis()
|
||||
yield test_client
|
||||
|
Loading…
x
Reference in New Issue
Block a user