Skip to content

Commit 016060c

Browse files
committed
Fix python-gino/gino#187, support Python 3.5
1 parent b2093f1 commit 016060c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_sanic.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import gino
22
import sanic
33
import pytest
4+
from async_generator import yield_, async_generator
45
from sanic.response import text, json
56
from gino.ext.sanic import Gino
67

@@ -9,6 +10,7 @@
910

1011
# noinspection PyShadowingNames
1112
@pytest.fixture
13+
@async_generator
1214
async def app():
1315
app = sanic.Sanic()
1416
app.config['DB_HOST'] = DB_ARGS['host']
@@ -60,7 +62,7 @@ async def add_user(request):
6062
try:
6163
try:
6264
await db.gino.create_all(e)
63-
yield app
65+
await yield_(app)
6466
finally:
6567
await db.gino.drop_all(e)
6668
finally:
@@ -78,7 +80,7 @@ def test(app):
7880
assert response.status == 404
7981

8082
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)
8284
assert response.status == 404
8385

8486
request, response = app.test_client.post('/users',

0 commit comments

Comments
 (0)