diff --git a/tests/test_hook_to_custom_response.py b/tests/test_hook_to_custom_response.py index 5c9b855..4a8662a 100644 --- a/tests/test_hook_to_custom_response.py +++ b/tests/test_hook_to_custom_response.py @@ -37,14 +37,14 @@ class ArticleView(PydanticView): async def test_post_an_article_with_wrong_type_field_should_return_an_error_message( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) client = await aiohttp_client(app) resp = await client.post("/article", json={"name": "foo", "nb_page": "foo"}) - a = await resp.text() + assert resp.status == 400 assert resp.content_type == "application/json" assert await resp.json() == [ diff --git a/tests/test_validation_body.py b/tests/test_validation_body.py index 5e5fcc9..8df3f35 100644 --- a/tests/test_validation_body.py +++ b/tests/test_validation_body.py @@ -29,7 +29,7 @@ class ArticleView(PydanticView): async def test_post_an_article_without_required_field_should_return_an_error_message( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) @@ -49,7 +49,7 @@ async def test_post_an_article_without_required_field_should_return_an_error_mes async def test_post_an_article_with_wrong_type_field_should_return_an_error_message( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) @@ -81,7 +81,7 @@ async def test_post_an_array_json_is_supported(aiohttp_client, event_loop): async def test_post_an_array_json_to_an_object_model_should_return_an_error( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) @@ -101,7 +101,7 @@ async def test_post_an_array_json_to_an_object_model_should_return_an_error( async def test_post_an_object_json_to_a_list_model_should_return_an_error( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) diff --git a/tests/test_validation_header.py b/tests/test_validation_header.py index 19843cc..2d7c734 100644 --- a/tests/test_validation_header.py +++ b/tests/test_validation_header.py @@ -61,7 +61,7 @@ class ArticleViewWithSignatureGroup(PydanticView): async def test_get_article_without_required_header_should_return_an_error_message( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) @@ -81,7 +81,7 @@ async def test_get_article_without_required_header_should_return_an_error_messag async def test_get_article_with_wrong_header_type_should_return_an_error_message( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) @@ -101,7 +101,7 @@ async def test_get_article_with_wrong_header_type_should_return_an_error_message async def test_get_article_with_valid_header_should_return_the_parsed_type( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) @@ -116,7 +116,7 @@ async def test_get_article_with_valid_header_should_return_the_parsed_type( async def test_get_article_with_valid_header_containing_hyphen_should_be_returned( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) diff --git a/tests/test_validation_path.py b/tests/test_validation_path.py index ae8a453..dd43c74 100644 --- a/tests/test_validation_path.py +++ b/tests/test_validation_path.py @@ -11,7 +11,7 @@ class ArticleView(PydanticView): async def test_get_article_with_correct_path_parameters_should_return_parameters_in_path( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article/{author_id}/tag/{tag}/before/{date}", ArticleView) @@ -24,7 +24,7 @@ async def test_get_article_with_correct_path_parameters_should_return_parameters async def test_get_article_with_wrong_path_parameters_should_return_error( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article/{author_id}/tag/{tag}/before/{date}", ArticleView) diff --git a/tests/test_validation_query_string.py b/tests/test_validation_query_string.py index d50a56f..a1b610c 100644 --- a/tests/test_validation_query_string.py +++ b/tests/test_validation_query_string.py @@ -55,7 +55,7 @@ class ArticleViewWithPaginationGroup(PydanticView): async def test_get_article_without_required_qs_should_return_an_error_message( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) @@ -75,7 +75,7 @@ async def test_get_article_without_required_qs_should_return_an_error_message( async def test_get_article_with_wrong_qs_type_should_return_an_error_message( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) @@ -95,7 +95,7 @@ async def test_get_article_with_wrong_qs_type_should_return_an_error_message( async def test_get_article_with_valid_qs_should_return_the_parsed_type( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) @@ -114,7 +114,7 @@ async def test_get_article_with_valid_qs_should_return_the_parsed_type( async def test_get_article_with_valid_qs_and_omitted_optional_should_return_default_value( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView) @@ -133,7 +133,7 @@ async def test_get_article_with_valid_qs_and_omitted_optional_should_return_defa async def test_get_article_with_multiple_value_for_qs_age_must_failed( - aiohttp_client, loop + aiohttp_client, event_loop ): app = web.Application() app.router.add_view("/article", ArticleView)