将命令行生成的python .coverage文件与PyDev集成 [英] Integrating command-line generated python .coverage files with PyDev

查看:80
本文介绍了将命令行生成的python .coverage文件与PyDev集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的构建环境配置为在命令行上编译,运行和创建coverage文件(使用Ned Batchelder coverage.py工具)。

My build environment is configured to compile, run and create coverage file at the command line (using Ned Batchelder coverage.py tool).

我使用的是PyDev作为编辑器的Eclipse,但出于实际原因,将整个构建环境转换为Eclipse(从而生成

I'm using Eclipse with PyDev as my editor, but for practical reasons, it's not possible/convenient for me to convert my whole build environment to Eclipse (and thus generate the coverage data directly from the IDE, as it's designed to do)

PyDev似乎正在使用相同的覆盖率工具(或与之非常相似的东西)来生成其覆盖率信息,所以我猜测应该有某种方式将我的外部覆盖文件集成到Eclipse / PyDev中。

PyDev seems to be using the same coverage tool (or something very similar to it) to generate its coverage information, so I'm guessing there should be some way of integrating my external coverage files into Eclipse/PyDev.

关于如何执行此操作的任何想法?

Any idea on how to do this?

推荐答案

前一段时间,当PyDev仍使用 coverage.py的旧版本时,我确实需要类似的东西

I needed exactly something like this some time ago, when PyDev still used an older version of coverage.py than the one accessible from the script creator's page.

我所做的就是检测PyDev在哪里保存他的 .coverage 文件。对我来说是

What I did was detecting where PyDev was saving his .coverage file. For me it was:

 C:\Users\Admin\workspace\.metadata\.plugins\org.python.pydev.debug\.coverage

然后我手动运行了 coverage.py 从一个单独的脚本中删除,并告诉它将.coverage文件保存在PyDev保存文件的位置。我不记得是否有 coverage.py 的命令行参数,或者是否只是复制了 .coverage 文件使用脚本,但是此后,如果您只打开代码覆盖率结果视图,然后单击刷新覆盖率信息!,PyDev将很好地处理数据,就像生成文件一样本身。

Then I manually ran a new version of coverage.py from a separate script and told it to save its .coverage file in the place where PyDev saves its. I cannot remember if there is a command-line argument to coverage.py or if I simply copied the .coverage file with a script, but after that, if you simply open the Code Coverage Results View and click Refresh coverage information!, PyDev will nicely process the data as if it generated the file itself.

这篇关于将命令行生成的python .coverage文件与PyDev集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆