我正在使用鼻子和覆盖率来生成覆盖率报告。我现在只有一个包ae,所以我指定只涵盖:
nosetests -w tests/unit --with-xunit --with-coverage --cover-package=ae
以下是看起来不错的结果:
Name Stmts Exec Cover Missing
----------------------------------------------
ae 1 1 100%
ae.util 253 224 88% 39, 63-65, 284, 287, 362, 406
----------------------------------------------
TOTAL 263 234 88%
----------------------------------------------------------------------
Ran 68 tests in 5.292s
但是,当我运行时coverage xml
,coverage 会引入不必要的包,包括与我的代码无关的python电子邮件和日志记录包。
如果我运行coverage xml ae
,我会收到此错误:
No source for code: '/home/wraith/dev/projects/trimurti/src/ae':
[Errno 21] Is a directory: '/home/wraith/dev/projects/trimurti/src/ae'
有没有办法为ae包生成 XML?