
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
pytest plugin for aiohttp support
The library provides useful fixtures for creation test aiohttp server and client.
.. 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.
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.
FAQs
Pytest plugin for aiohttp support
We found that pytest-aiohttp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.