【发布时间】:2019-02-07 13:12:46
【问题描述】:
https://coverage.readthedocs.io/en/coverage-4.5.1a/source.html#source
我的报道还包括“venv”文件夹,我想排除它 无论我做什么,即使使用 --include 或 omit 都没有用
coverage run --omit /venv/* tests.py
这会运行测试,但仍会添加“venv”文件夹和依赖项及其覆盖率百分比
当我这样做时
coverage run --include tests.py
只运行测试 - 它说
Nothing to do.
这很烦人...有人可以帮忙吗?
【问题讨论】:
-
改用
coverage run --include tests.py -m tests.py -
@Radek 你有没有找到解决方案?我已经尝试了以下建议的所有组合,但无法排除 venv 中的 python 文件。
标签: python python-3.x unit-testing coverage.py python-venv