skip tests if python version is not 3.7 at least
This commit is contained in:
parent
eed22a7a24
commit
757974714e
|
@ -1,7 +1,6 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
|
import sys
|
||||||
from asyncio import base_events as asyncio_base_events
|
|
||||||
|
|
||||||
from inspect import isawaitable
|
from inspect import isawaitable
|
||||||
import pytest
|
import pytest
|
||||||
|
@ -20,14 +19,19 @@ def test_app_loop_running(app):
|
||||||
assert response.text == "pass"
|
assert response.text == "pass"
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.version_info < (3, 7),
|
||||||
|
reason="requires python3.7 or higher")
|
||||||
def test_create_asyncio_server(app):
|
def test_create_asyncio_server(app):
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
asyncio_srv_coro = app.create_server(return_asyncio_server=True)
|
asyncio_srv_coro = app.create_server(
|
||||||
|
return_asyncio_server=True)
|
||||||
assert isawaitable(asyncio_srv_coro)
|
assert isawaitable(asyncio_srv_coro)
|
||||||
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
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.version_info < (3, 7),
|
||||||
|
reason="requires python3.7 or higher")
|
||||||
def test_asyncio_server_start_serving(app):
|
def test_asyncio_server_start_serving(app):
|
||||||
try:
|
try:
|
||||||
import uvloop
|
import uvloop
|
||||||
|
|
Loading…
Reference in New Issue
Block a user