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,8 +26,13 @@ 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)
srv = loop.run_until_complete(asyncio_srv_coro)
assert srv.is_serving() is True try:
import uvloop
except ImportError:
# this test is valid only for sanic + asyncio setup
srv = loop.run_until_complete(asyncio_srv_coro)
assert srv.is_serving() is True
@pytest.mark.skipif(sys.version_info < (3, 7), @pytest.mark.skipif(sys.version_info < (3, 7),