Skip to content

Commit

Permalink
refactor: httpx transport warning fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
grillazz committed Mar 24, 2024
1 parent 7e34800 commit 85789ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions db/create.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-- DROP DATABASE IF EXISTS devdb;
-- CREATE DATABASE devdb;
\connect devdb;
CREATE SCHEMA shakespeare;
CREATE SCHEMA happy_hog;
Expand Down
10 changes: 8 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

0 comments on commit 85789ee

Please sign in to comment.