diff --git a/requirements-test.txt b/requirements-test.txt index a4646c19..b39f1ef8 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,6 +1,7 @@ -pytest==8.3.5 +pytest==8.4.0 pytest-pep8==1.0.6 pytest-cov==6.1.1 pytest-aiohttp==1.1.0 +pytest-asyncio==1.0.0 responses==0.25.7 pytest_httpserver >= 1.1.2 diff --git a/tests/async_api/test_get_message_content.py b/tests/async_api/test_get_message_content.py index cdf08b3c..a0a8be57 100644 --- a/tests/async_api/test_get_message_content.py +++ b/tests/async_api/test_get_message_content.py @@ -12,6 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. +import pytest + from aiohttp import web from linebot import ( @@ -20,6 +22,7 @@ from linebot.aiohttp_async_http_client import AiohttpAsyncHttpClient +@pytest.mark.asyncio async def test_get(aiohttp_client): msg = ''.join('Hello, world' for i in range(1000)) diff --git a/tests/async_api/test_get_profile.py b/tests/async_api/test_get_profile.py index 709d7a3b..c2a7fea7 100644 --- a/tests/async_api/test_get_profile.py +++ b/tests/async_api/test_get_profile.py @@ -12,6 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. +import pytest + from aiohttp import web from linebot import ( @@ -20,6 +22,7 @@ from linebot.aiohttp_async_http_client import AiohttpAsyncHttpClient +@pytest.mark.asyncio async def test_async_profile(aiohttp_client): expect = { 'displayName': 'test', diff --git a/tests/test_aiohttp_async_http_client.py b/tests/test_aiohttp_async_http_client.py index 0bc1ca30..e3049ad1 100644 --- a/tests/test_aiohttp_async_http_client.py +++ b/tests/test_aiohttp_async_http_client.py @@ -12,11 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. +import pytest from aiohttp import web from linebot.aiohttp_async_http_client import AiohttpAsyncHttpClient +@pytest.mark.asyncio async def test_get(aiohttp_client): async def hello(request): return web.Response(text='Hello, world') @@ -31,6 +33,7 @@ async def hello(request): assert 'Hello, world' in text +@pytest.mark.asyncio async def test_get_json(aiohttp_client): async def hello(request): return web.json_response({'test': 'Hello, world'}) @@ -44,6 +47,7 @@ async def hello(request): assert 'Hello, world' == json['test'] +@pytest.mark.asyncio async def test_get_iter(aiohttp_client): async def hello(request): return web.Response(text='Hello, world') @@ -61,6 +65,7 @@ async def hello(request): assert 'Hello, world' in buffer +@pytest.mark.asyncio async def test_post(aiohttp_client): async def hello(request): return web.Response(text='Hello, world') @@ -75,6 +80,7 @@ async def hello(request): assert 'Hello, world' in text +@pytest.mark.asyncio async def test_delete(aiohttp_client): async def hello(request): return web.Response(text='Hello, world') @@ -89,6 +95,7 @@ async def hello(request): assert 'Hello, world' in text +@pytest.mark.asyncio async def test_put(aiohttp_client): async def hello(request): return web.Response(text='Hello, world')