跳至主要内容

pytest-asyncio-network-simulator:pytest的插件,用于在测试中模拟网络

项目描述

Join the chat at https://gitter.im/ethereum/pytest-asyncio-network-simulator Build Status PyPI version Python versions Docs build

pytest的插件,该插件在多个asyncio API中模拟网络,以便而不是通过套接字打开和通信,通信直接在内存中发生。

在ReadTheDocs上的[文档](https://pytest-asyncio-network-simulator.readthedocs.io/)中了解更多信息。[查看变更日志](https://pytest-asyncio-network-simulator.readthedocs.io/en/latest/releases.html)。

快速入门

pip install pytest-asyncio-network-simulator

开发者设置

如果您想修改 pytest-asyncio-network-simulator,请查阅 以太坊开发战术手册 了解我们的做法。

  • 测试

  • 拉取请求

  • 代码风格

  • 文档

开发环境搭建

您可以使用以下方式搭建您的开发环境:

git clone git@github.com:ethereum/pytest-asyncio-network-simulator.git
cd pytest-asyncio-network-simulator
virtualenv -p python3 venv
. venv/bin/activate
pip install -e .[dev]

测试设置

在开发过程中,您可能希望每次保存文件时都运行测试。

在文件更改时显示 flake8 错误

# Test flake8
when-changed -v -s -r -1 asyncio_network_simulator/ tests/ -c "clear; flake8 asyncio_network_simulator tests && echo 'flake8 success' || echo 'error'"

使用一个命令运行多进程测试,但不显示颜色

# in the project root:
pytest --numprocesses=4 --looponfail --maxfail=1
# the same thing, succinctly:
pytest -n 4 -f --maxfail=1

在一个线程中运行,显示颜色和桌面通知

cd venv
ptw --onfail "notify-send -t 5000 'Test failure ⚠⚠⚠⚠⚠' 'python 3 test on pytest-asyncio-network-simulator failed'" ../tests ../asyncio_network_simulator

发布设置

对于类似 Debian 的系统

apt install pandoc

要发布新版本

make release bump=$$VERSION_PART_TO_BUMP$$

如何使用 bumpversion

本仓库的版本格式为稳定版 {major}.{minor}.{patch},不稳定版为 {major}.{minor}.{patch}-{stage}.{devnum}(阶段可以是 alpha 或 beta)。

要发布下一个版本,指定要提升的部分,例如 make release bump=minormake release bump=devnum

如果您处于 beta 版本,make release bump=stage 将切换到稳定版。

当当前版本为稳定版时,要发布不稳定版,请明确指定新版本,例如 make release bump="--new-version 4.0.0-alpha.1 devnum"

项目详情


下载文件

下载适合您平台的文件。如果您不确定该选择哪个,请了解有关 安装包 的更多信息。

源代码分发

pytest-asyncio-network-simulator-0.1.0a2.tar.gz (7.7 kB 查看散列值)

上传时间 源代码

构建分发

pytest_asyncio_network_simulator-0.1.0a2-py3-none-any.whl (10.5 kB 查看散列值)

上传时间 Python 3

由以下机构支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面