File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import gino
2
2
import sanic
3
3
import pytest
4
+ from async_generator import yield_ , async_generator
4
5
from sanic .response import text , json
5
6
from gino .ext .sanic import Gino
6
7
9
10
10
11
# noinspection PyShadowingNames
11
12
@pytest .fixture
13
+ @async_generator
12
14
async def app ():
13
15
app = sanic .Sanic ()
14
16
app .config ['DB_HOST' ] = DB_ARGS ['host' ]
@@ -60,7 +62,7 @@ async def add_user(request):
60
62
try :
61
63
try :
62
64
await db .gino .create_all (e )
63
- yield app
65
+ await yield_ ( app )
64
66
finally :
65
67
await db .gino .drop_all (e )
66
68
finally :
@@ -78,7 +80,7 @@ def test(app):
78
80
assert response .status == 404
79
81
80
82
for method in '1234' :
81
- request , response = app .test_client .get (f '/users/1?method={ method } ' )
83
+ request , response = app .test_client .get ('/users/1?method=' + method )
82
84
assert response .status == 404
83
85
84
86
request , response = app .test_client .post ('/users' ,
You can’t perform that action at this time.
0 commit comments