All Projects → aio-libs → pytest-aiohttp

aio-libs / pytest-aiohttp

Licence: Apache-2.0 license
pytest plugin for aiohttp support

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pytest-aiohttp

trellio
Python3 asyncio based microframework for microservice architecture
Stars: ✭ 19 (-82.73%)
Mutual labels:  aiohttp, asyncio
Aiohttp Security
auth and permissions for aiohttp
Stars: ✭ 195 (+77.27%)
Mutual labels:  aiohttp, asyncio
Bolt Python
A framework to build Slack apps using Python
Stars: ✭ 190 (+72.73%)
Mutual labels:  aiohttp, asyncio
Owllook
owllook-小说搜索引擎
Stars: ✭ 2,163 (+1866.36%)
Mutual labels:  aiohttp, asyncio
Python Mocket
a socket mock framework - for all kinds of socket animals, web-clients included
Stars: ✭ 209 (+90%)
Mutual labels:  aiohttp, asyncio
Aiohttp Jinja2
jinja2 template renderer for aiohttp.web
Stars: ✭ 180 (+63.64%)
Mutual labels:  aiohttp, asyncio
aioneo4j
asyncio client for neo4j
Stars: ✭ 29 (-73.64%)
Mutual labels:  aiohttp, asyncio
Linkedin Learning Downloader
Linkedin Learning videos downloader
Stars: ✭ 171 (+55.45%)
Mutual labels:  aiohttp, asyncio
Create Aio App
The boilerplate for aiohttp. Quick setup for your asynchronous web service.
Stars: ✭ 207 (+88.18%)
Mutual labels:  aiohttp, asyncio
Aiohttp admin
admin interface for aiohttp application http://aiohttp-admin.readthedocs.io
Stars: ✭ 207 (+88.18%)
Mutual labels:  aiohttp, asyncio
yutto
🧊 一个可爱且任性的 B 站视频下载器(bilili V2)
Stars: ✭ 383 (+248.18%)
Mutual labels:  aiohttp, asyncio
Tokio
Asyncio event loop written in Rust language
Stars: ✭ 236 (+114.55%)
Mutual labels:  aiohttp, asyncio
Aiohttp Cors
CORS support for aiohttp
Stars: ✭ 173 (+57.27%)
Mutual labels:  aiohttp, asyncio
Aiohttp Debugtoolbar
aiohttp_debugtoolbar is library for debugtoolbar support for aiohttp
Stars: ✭ 183 (+66.36%)
Mutual labels:  aiohttp, asyncio
Aiohttp Apispec
Build and document REST APIs with aiohttp and apispec
Stars: ✭ 172 (+56.36%)
Mutual labels:  aiohttp, asyncio
Fooproxy
稳健高效的评分制-针对性- IP代理池 + API服务,可以自己插入采集器进行代理IP的爬取,针对你的爬虫的一个或多个目标网站分别生成有效的IP代理数据库,支持MongoDB 4.0 使用 Python3.7(Scored IP proxy pool ,customise proxy data crawler can be added anytime)
Stars: ✭ 195 (+77.27%)
Mutual labels:  aiohttp, asyncio
Gain
Web crawling framework based on asyncio.
Stars: ✭ 2,002 (+1720%)
Mutual labels:  aiohttp, asyncio
Aiohttp Session
Web sessions for aiohttp.web
Stars: ✭ 171 (+55.45%)
Mutual labels:  aiohttp, asyncio
Aiohttp Devtools
dev tools for aiohttp
Stars: ✭ 202 (+83.64%)
Mutual labels:  aiohttp, asyncio
Arsenic
Async WebDriver implementation for asyncio and asyncio-compatible frameworks
Stars: ✭ 209 (+90%)
Mutual labels:  aiohttp, asyncio

pytest-aiohttp

pytest plugin for aiohttp support

The library provides useful fixtures for creation test aiohttp server and client.

Installation

$ pip install pytest-aiohttp

Add asyncio_mode = auto line to pytest configuration (see pytest-asyncio modes for details). The plugin works with strict mode also.

Usage

Write tests in 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:

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].