最後更新: 2020-12-11
介紹
nose isn't really a unit testing framework.
It's a test runner and a great one at that. It can run tests created using pyUnit, py.test or doctest
P.S.
Python unittest's builtin testrunner does not run tests in parallel.
Install
pip install nosetests
獲得: /usr/local/bin/nosetests
Any python source file, directory or package that matches the testMatch regular expression
By default: (?:^|[\b_\.-])[Tt]est) will be collected as a test
P.S.
Package discovery descends all the way down the tree
有用的 options
-w where
-m TESTMATCH
-x, --stop
Stop running tests after the first error or failure
working directory
nosetests -w /path/to/tests
.noserc
[nosetests] verbosity=3 with-doctest=1
Usage
nosetests /path/to/tests /another/path/to/tests
nosetests --processes=NUM --process-timeout=SECONDS