Memorandum Abdeckung setzen
$ pip install coverage
Versuchen
$ 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
Es war voll! Ich möchte Informationen über unnötige Module löschen!
$ 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
Ist verschwunden!
Übrigens werden die Optionen immer länger, machen Sie es also zu einer Einstellungsdatei
.noserc
[nosetests]
with-coverage=true
cover-package=mymodule
Lauf
$ nosetests --config=.noserc
Das Ende
Recommended Posts