File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change
1
+ -- DROP DATABASE IF EXISTS devdb;
2
+ -- CREATE DATABASE devdb;
1
3
\connect devdb;
2
4
CREATE SCHEMA shakespeare ;
3
5
CREATE SCHEMA happy_hog ;
Original file line number Diff line number Diff line change 1
1
import pytest
2
- from httpx import AsyncClient
2
+ from httpx import AsyncClient , ASGITransport
3
3
4
4
from app .database import engine
5
5
from app .main import app
@@ -29,10 +29,16 @@ async def start_db():
29
29
30
30
@pytest .fixture (scope = "session" )
31
31
async def client (start_db ) -> AsyncClient :
32
- async with AsyncClient (
32
+
33
+ transport = ASGITransport (
33
34
app = app ,
35
+
36
+ )
37
+ async with AsyncClient (
38
+ # app=app,
34
39
base_url = "http://testserver/v1" ,
35
40
headers = {"Content-Type" : "application/json" },
41
+ transport = transport ,
36
42
) as test_client :
37
43
app .state .redis = await get_redis ()
38
44
yield test_client
You can’t perform that action at this time.
0 commit comments