pytest-asyncio-network-simulator:pytest的插件,用于在测试中模拟网络
项目描述
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=minor 或 make 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 的散列值
算法 | 散列摘要 | |
---|---|---|
SHA256 | bdb04369e3cdedf1c82f0f121035e78c9271a395ffe7c1fa310c4e7c58547921 |
|
MD5 | 04526bd8e1d5df9916043f04653c0745 |
|
BLAKE2b-256 | 179eeda101e6ce3660ec18e27aebe2f7c122c3c231a067f84adcc0a68341a914 |
pytest_asyncio_network_simulator-0.1.0a2-py3-none-any.whl 的散列值
算法 | 散列摘要 | |
---|---|---|
SHA256 | 93e92f8eec30b681566d8f7ea71dd6a504b402a910874139f6f23674441f7684 |
|
MD5 | e64a5e1cba183ec1249d6554dd8ea32f |
|
BLAKE2b-256 | c0457b4246e10a35529d40dce6bee0d9ef8e8679dace8cb35bf823309e04e2ed |