mémorandum mettre la couverture
$ pip install coverage
Essayer
$ nosetests --with-coverage
..................
Name Stmts Miss Branch BrMiss Cover Missing
-----------------------------------------------------------------------
ctypes 333 333 108 108 0% 3-543
ctypes._endian 33 33 14 14 0% 1-59
ctypes.macholib 1 1 0 0 0% 9
ctypes.macholib.dyld 88 88 42 42 0% 5-158
ctypes.macholib.dylib 20 20 4 4 0% 5-63
ctypes.macholib.framework 23 23 4 4 0% 5-65
ctypes.util 159 159 69 69 0% 1-236
mymodule 6 0 0 0 100%
uuid 301 301 131 131 0% 47-581
-----------------------------------------------------------------------
TOTAL 1256 966 460 384 21%
----------------------------------------------------------------------
Ran 18 tests in 0.073s
OK
Il était plein! Je veux effacer les informations sur les modules inutiles!
$ nosetests --with-coverage --cover-package=mymodule
..................
Name Stmts Miss Branch BrMiss Cover Missing
-------------------------------------------------------------------
mymodule 6 0 0 0 100%
-------------------------------------------------------------------
TOTAL 298 8 88 12 100%
----------------------------------------------------------------------
Ran 18 tests in 0.073s
OK
Avait disparu!
Au fait, les options s'allongent, alors faites-en un fichier de paramètres
.noserc
[nosetests]
with-coverage=true
cover-package=mymodule
Courir
$ nosetests --config=.noserc
La fin
Recommended Posts