pytest plugin for aiohttp support
Project description
pytest-aiohttp
pytest plugin for aiohttp support
The library allows to use [aiohttp pytest pugin](http://aiohttp.readthedocs.io/en/stable/testing.html#pytest-example) without need for implicitly loading it like pytest_plugins = ‘aiohttp.pytest_plugin’.
Just run:
$ pip install pytest-aiohttp
and write tests with the plugin support:
from aiohttp import web
- async def hello(request):
return web.Response(body=b’Hello, world’)
- def create_app(loop):
app = web.Application(loop=loop) app.router.add_route(‘GET’, ‘/’, hello) return app
- async def test_hello(test_client):
client = await test_client(create_app) resp = await client.get(‘/’) assert resp.status == 200 text = await resp.text() assert ‘Hello, world’ in text
CHANGES
0.1.0 (2016-07-22)
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytest-aiohttp-0.1.0.tar.gz
.
File metadata
- Download URL: pytest-aiohttp-0.1.0.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ff9d10f776e5ba162a0414a16fd3904cc84ea1bbbce076c14c0ceffa9bdffdb |
|
MD5 | adde74cc854b4f5c33058e09e1fb1ed2 |
|
BLAKE2b-256 | ac5127233f91a2d3a222729d3887cb0c28cfaa22ce207ab20567c81414ae9604 |
Provenance
File details
Details for the file pytest_aiohttp-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_aiohttp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43800066b1e28d0d689b31061b624da10dc239359416056d315b6dc18a15474a |
|
MD5 | f90aa5a3d5203690cdb8a9b8695ad4c2 |
|
BLAKE2b-256 | a6b4d0a5af0232e5df7c2770868eea427593c9388dc9e26d21b6ef1e0dfada1c |