【文件属性】:
文件名称:pytest-sanic:Sanic的Pytest插件
文件大小:39KB
文件格式:ZIP
更新时间:2021-05-08 06:08:37
sanic python3 pytest asyncio pytest-plugin
pytest-sanic
建造
文件
包裹
一个pytest插件。 它可以帮助您异步测试代码。
该插件提供:
使用异步协程非常简单的测试
常用和有用的装置
异步夹具支持
用于Sanic应用程序的test_client / sanic_client
用于Sanic应用程序的test_server
你可以在这里查询更多详情:
发行和变更日志可以在这里找到:
安装
pip install pytest-sanic
快速开始
您不必显式加载pytest-sanic 。 pytest将为您做到。
您可以为您的app设置灯具,如下所示:
import pytest
from . app import create_app
@ pytest . yield_fixture
def app ():
app = create_app ( test_config , ** par
【文件预览】:
pytest-sanic-master
----setup.py(1KB)
----poetry.lock(38KB)
----.gitignore(172B)
----pyproject.toml(817B)
----.travis.yml(211B)
----.python-version(6B)
----LICENSE(11KB)
----README.rst(10KB)
----tests()
--------conftest.py(2KB)
--------test_async.py(111B)
--------__init__.py(0B)
--------test_simple_fixtures.py(337B)
--------test_server.py(768B)
--------test_fixture.py(958B)
--------test_client.py(3KB)
--------test_client_websocket.py(301B)
----docs()
--------Makefile(8KB)
--------index.rst(2KB)
--------async_fixture.rst(305B)
--------installation.rst(222B)
--------make.bat(8KB)
--------tips.rst(1KB)
--------development.rst(287B)
--------fixtures.rst(6KB)
--------example.rst(586B)
--------reference.rst(256B)
----pytest_sanic()
--------__init__.py(22B)
--------plugin.py(6KB)
--------utils.py(8KB)