2014-11-21 105 views
1

我有我的Python應用程序構建爲一個目錄如下:nosetests - 不包括覆蓋報告

proj 
    - comp1 
    - comp2 
tests 
    - comp1 
    - comp2 
other 
    - contains some python code 

我正在nosetests如下:

nosetests --with-coverage --cover-package=proj --exclude-dir=other -v tests 

然而,在覆蓋報告中指出nosetests打印結束時,我仍然從「其他」輸入。如何從覆蓋率報告中排除「其他」?

回答

0

很可能你的testsproj指的是other的python代碼,因此它會將它編譯成報告。您可以看到調試覆蓋率插件打印輸出:

nosetests --with-coverage --cover-package=proj -vv tests -l nose.plugins.cover 
+0

是的,proj引用'其他'python代碼。 「其他」實際上是一組第三方python庫。這就是爲什麼我想將它從覆蓋報告中排除。 – 2014-11-26 00:47:12