报告覆盖范围内未测试的 python 文件

发布于 2025-01-17 16:14:34 字数 217 浏览 7 评论 0原文

我正在为现有项目编写测试用例,并且要测试多个Python文件,即使该文件没有测试柜,我也想知道项目目录下所有文件的覆盖范围报告。 我运行以下命令

当 未显示另一个尚未测试的文件。

我已经尝试使用以下命令以及覆盖范围运行-source =。 -m pytest测试/& amp;覆盖范围报告-M

任何人都可以帮助您的可能性吗?

I am writting the test cases for an existing project and there are multiple python files to be tested, I would like to know the coverage report for all the files under project directory even though there is no testcases wrritten for this file. When I run the below command

pytest --cache-clear --cov-report term-missing --cov=services/ tests/

Report only shows the file which has the test cases under tests/ directory but not showing the other yet to tested files.

I have tried with the below command as well coverage run --source=. -m pytest tests/ && coverage report -m

Can anyone please help how it is possible ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文