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.1 (2016-07-22)
Fix an url in setup.py
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.1.tar.gz
.
File metadata
- Download URL: pytest-aiohttp-0.1.1.tar.gz
- Upload date:
- Size: 2.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45854090db2e78d00117166ccbef97ae877ff16afc64ae718b548e61b2a8a8a5 |
|
MD5 | a595b5a51f8f5461d6cd5fe074a039e5 |
|
BLAKE2b-256 | 695210bf4cd323a0f16948fd2b45e125b4ce4c294677612f5e3ea9a6867d5e0e |
File details
Details for the file pytest_aiohttp-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: pytest_aiohttp-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2fef3b573175268ea296862fc74d98635d5bfa2264209b82ec44a4385e86fd4 |
|
MD5 | 6dd8e37e649680071f33629742921b49 |
|
BLAKE2b-256 | 49c982bc5d0f037313c480d9435f1bd75121c0151453d51dd9cabdb67eaf3d5e |