make tests dependent on uvloop

This commit is contained in:
Denis Makogon 2019-01-15 17:30:32 +02:00
parent 757974714e
commit 1af16836d4

View File

@ -26,6 +26,11 @@ def test_create_asyncio_server(app):
asyncio_srv_coro = app.create_server( asyncio_srv_coro = app.create_server(
return_asyncio_server=True) return_asyncio_server=True)
assert isawaitable(asyncio_srv_coro) assert isawaitable(asyncio_srv_coro)
try:
import uvloop
except ImportError:
# this test is valid only for sanic + asyncio setup
srv = loop.run_until_complete(asyncio_srv_coro) srv = loop.run_until_complete(asyncio_srv_coro)
assert srv.is_serving() is True assert srv.is_serving() is True