freshcrate
Home > Frameworks > pytest-aiohttp

pytest-aiohttp

Pytest plugin for aiohttp support

Description

pytest-aiohttp ============== pytest plugin for aiohttp support The library provides useful fixtures for creation test aiohttp server and client. Installation ------------ .. code-block:: console $ pip install pytest-aiohttp Add ``asyncio_mode = auto`` line to `pytest configuration <https://docs.pytest.org/en/latest/customize.html>`_ (see `pytest-asyncio modes <https://github.com/pytest-dev/pytest-asyncio#modes>`_ for details). The plugin works with ``strict`` mode also. Usage ----- Write tests in `pytest-asyncio <https://github.com/pytest-dev/pytest-asyncio>`_ style using provided fixtures for aiohttp test server and client creation. The plugin provides resources cleanup out-of-the-box. The simple usage example: .. code-block:: python from aiohttp import web async def hello(request): return web.Response(body=b"Hello, world") def create_app(): app = web.Application() app.router.add_route("GET", "/", hello) return app async def test_hello(aiohttp_client): client = await aiohttp_client(create_app()) resp = await client.get("/") assert resp.status == 200 text = await resp.text() assert "Hello, world" in text See `aiohttp documentation <https://docs.aiohttp.org/en/stable/testing.html#pytest>` for more details about fixtures usage.

Release History

VersionChangesUrgencyDate
1.1.0Imported from PyPI (1.1.0)Low4/21/2026
v1.1.0pytest-aiohttp ============== pytest plugin for aiohttp support The library provides useful fixtures for creation test aiohttp server and client. Installation ------------ .. code-block:: console $ pip install pytest-aiohttp Add ``asyncio_mode = auto`` line to `pytest configuration <https://docs.pytest.org/en/latest/customize.html>`_ (see `pytest-asyncio modes <https://github.com/pytest-dev/pytest-asyncio#modes>`_ for details). The plugin works with ``strict`` mode also. Usage ---Low1/23/2025
v1.0.5pytest-aiohttp ============== pytest plugin for aiohttp support The library provides useful fixtures for creation test aiohttp server and client. Installation ------------ .. code-block:: console $ pip install pytest-aiohttp Add ``asyncio_mode = auto`` line to `pytest configuration <https://docs.pytest.org/en/latest/customize.html>`_ (see `pytest-asyncio modes <https://github.com/pytest-dev/pytest-asyncio#modes>`_ for details). The plugin works with ``strict`` mode also. Usage ---Low9/6/2023
v1.0.4pytest-aiohttp ============== pytest plugin for aiohttp support The library provides useful fixtures for creation test aiohttp server and client. Installation ------------ .. code-block:: console $ pip install pytest-aiohttp Add ``asyncio_mode = auto`` line to `pytest configuration <https://docs.pytest.org/en/latest/customize.html>`_ (see `pytest-asyncio modes <https://github.com/pytest-dev/pytest-asyncio#modes>`_ for details). The plugin works with ``strict`` mode also. Usage ---Low2/12/2022
v0.2.0Changes ------------- - Fix backward incompatible changes introduced by `pytest` 3.3+ Low11/30/2017

Dependencies & License Audit

Loading dependencies...

Similar Packages

pre-commitA framework for managing and maintaining multi-language pre-commit hooks.v4.6.0
azure-core-tracing-opentelemetryMicrosoft Azure Azure Core OpenTelemetry plugin Library for Pythonazure-template_0.1.0b6187637
spdx-toolsSPDX parser and tools.0.8.5
lacesDjango components that know how to render themselves.0.1.2
django-tasksA backport of Django's built in Tasks framework0.12.0