从 django_coverage 中排除系统路径
我正在使用命令 test_coverage
在项目上运行 django_coverage。它正在工作,但它包含在 /usr/local/lib/python2.6/dist-packages
中的输出和最终计算代码中。我不想了解这些模块的覆盖范围,只想了解我的项目的测试覆盖范围。我在 BitBucket 上的 django_coverage 文档 中看到有一个 COVERAGE_PATH_EXCLUDES
,但这似乎仅适用于项目的子目录,而不适用于绝对系统路径。另外,我发现 COVERAGE_MODULE_EXCLUDES
的默认设置是排除其中包含“django”的任何导入,但我仍然得到 /usr/local/lib/python2.6/ 的输出dist-packages/django
.
关于如何解决这个问题有什么想法吗?
I'm running django_coverage over a project with the command test_coverage
. It's working, but it's including in the output and final calculation code in /usr/local/lib/python2.6/dist-packages
. I'm not interested in knowing about the coverage of those modules, only the test coverage for my project. I see in the django_coverage documentation on BitBucket that there is a COVERAGE_PATH_EXCLUDES
, but that seems to apply only to subdirectories of the project and not absolute system paths. Also, I see that the default for COVERAGE_MODULE_EXCLUDES
is to exclude any imports with "django" in it, but I'm still getting output for /usr/local/lib/python2.6/dist-packages/django
.
Any thoughts on how to fix this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
COVERAGE_PATH_EXCLUDES 中是否列出了“django”?我有一个类似的设置(django 1.1.2,python 2.6),在我的测试覆盖率结果中看不到任何 django 包的输出。您可以发布您用于排除的内容吗?
Do you have 'django' listed in COVERAGE_PATH_EXCLUDES? I have a similar setup (django 1.1.2, python 2.6) don't see the output for any django packages in my test coverage results. Can you post what you are using for the excludes?
我没有使用 django,所以我无法确认这一点,但您是否可能修改了原始代码设置文件,而不是按照步骤 3 中所述将设置包含在您自己的设置中(摘自下面的自述文件摘录):
I'm not using django so I can't confirm this, but is it possible that you have modified the original code settings file rather than including the settings in your own as it says in step 3 (from the readme excerpt below):