xdist运行后列出工作统计信息的pytest插件。
项目描述
pytest-xdist-worker-stats
xdist运行后列出工作统计信息的pytest插件。
安装
$ pip install pytest-xdist-worker-stats
用法
只需安装并启用xdist,并在多个工作器中运行测试即可。
默认模式
pytest {all_your_options}
============================= test session starts ==============================
platform linux -- Python 3.10.7, pytest-8.1.1, pluggy-1.4.0
plugins: xdist-worker-stats-0.2.0, xdist-3.5.0
created: 2/2 workers
2 workers [4 items]
.... [100%]
============================== Worker statistics ===============================
worker gw0 : 2 tests 0.00s runtime
worker gw1 : 2 tests 0.00s runtime
Tests : min 2, max 2, average 2.0
Runtime : min 0.00s, max 0.00s, average 0.00s
============================== 4 passed in 1.82s ===============================
摘要模式
pytest {all_your_options} --no-xdist-runtimes
============================= test session starts ==============================
platform linux -- Python 3.10.7, pytest-8.1.1, pluggy-1.4.0
plugins: xdist-worker-stats-0.2.0, xdist-3.5.0
created: 2/2 workers
2 workers [4 items]
.... [100%]
============================== Worker statistics ===============================
Tests : min 2, max 2, average 2.0
Runtime : min 0.00s, max 0.00s, average 0.00s
============================== 4 passed in 1.82s ===============================
分解模式
pytest {all_your_options} --xdist-breakdown
============================= test session starts ==============================
platform linux -- Python 3.10.7, pytest-8.1.1, pluggy-1.4.0
plugins: xdist-worker-stats-0.2.0, xdist-3.5.0
created: 2/2 workers
2 workers [4 items]
.... [100%]
============================== Worker statistics ===============================
worker gw0 : 2 tests 0.00s runtime
test_plugin.py::test_bar[1]
test_plugin.py::test_foo
worker gw1 : 2 tests 0.00s runtime
test_plugin.py::test_bar[2]
test_plugin.py::test_bar[3]
Tests : min 2, max 2, average 2.0
Runtime : min 0.00s, max 0.00s, average 0.00s
============================== 4 passed in 1.82s ===============================
开发
开发需要Poetry(依赖项)和pre-commit(编码标准)。
$ poetry install
$ pre-commit install
感谢
非常感谢Denys Korytkin提供的文章如何从pytest-xdist节点获取数据。
变更日志
0.1.4 (2023年8月8日)
- 总结统计数据
0.1.3 (2023年8月8日)
- 添加CI
0.1.2 (2023年6月19日)
- 修复几个问题
0.1.1 (2023年6月15日)
- 首次发布
项目详情
关闭
pytest_xdist_worker_stats-0.2.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 4da1811fbbe049fc8c032412dc9771c7c6ba44dda922ee48f0350556b1557f73 |
|
MD5 | 345be4dea921766d057403cb9a39d862 |
|
BLAKE2b-256 | ade497d497d1e0a031d6688bff6d49ab5afa464bf835f0c7c0c0ba037bbe6b14 |
关闭
pytest_xdist_worker_stats-0.2.0-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 8a6f9946be32000372f2117225fec34a34ce8d8ff4aa026f68d03f0880800909 |
|
MD5 | a9cbeb1f79103c61c63084fcd72dd5f1 |
|
BLAKE2b-256 | d64e7214268ac2e50728129126d7ea99cbd750f25f288d4ab2e31e38582bc674 |