gpt4 book ai didi

coverage.py - 如何配置 tox 以便它在单个环境而不是所有环境上运行 pytest 覆盖?

转载 作者:行者123 更新时间:2023-12-04 15:13:35 25 4
gpt4 key购买 nike

我确实有一个复杂的 tox.ini 配置,其中包含适用于不同版本 python 的多个环境。

我想知道如何告诉 tox 仅在默认的 python 解释器上运行覆盖。

问题之一是默认的 Python 环境可能因平台而异。

我确实有一个包装脚本,它调用 tox -e py25,py26,docs其中 -e 参数是检测到的 python 版本。

[tox]
...
[testenv:docs]
...
[testenv]
commands=py.test --cov-report xml --cov scripts
...
[testenv:py26]
...
[testenv:py25]
...

期望的行为:运行 pytest 覆盖单个环境(这应该与 jenkins 集成运行)。

最佳答案

我认为您可以使用并包含 [testenv:py]使用 python 解释器调用 tox 本身的环境。如果你在那里定义覆盖运行,你应该得到你想要的。

关于coverage.py - 如何配置 tox 以便它在单个环境而不是所有环境上运行 pytest 覆盖?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13729162/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com