memorandum put coverage
$ pip install coverage
Try
$ 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
It was full! I want to erase the information of unnecessary modules!
$ 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
Had disappeared!
By the way, the options are getting longer, so make it a configuration file
.noserc
[nosetests]
with-coverage=true
cover-package=mymodule
Run
$ nosetests --config=.noserc
The end
Recommended Posts