简体   繁体   English

在多个位置整理代码文件

[英]Collating code files in multiple locations

I'm trying to use coverage.py on my unittest -based tests. 我正在尝试在基于unittest的测试中使用coverage.py I see that there are multiple kinds of paths and they're not collated, so the coverage data is wrong. 我看到路径有多种,并且没有进行整理,因此coverage数据是错误的。

/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/<package>/file.py
/<package>/file.py
something.py

How can I tell coverage.py to treat the paths the same (eg to remove the "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages" prefix)? 如何告诉coverage.py对待路径相同(例如,删除“ /home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages”前缀)?

Create a [paths] section in your configuration file. 在配置文件中创建一个[paths]部分

Maybe you could help me out: this is easily the most over-looked thing in the coverage.py configuration file. 也许您可以帮帮我:这是coverage.py配置文件中最容易被忽视的事情。 What can I do in the docs to make it more easily found? 我可以在文档中做什么以使其更容易找到?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM