nosetest运行方式

基本运行

nosetests [options] [(optional) test files or directories]

import nose
nose.main()



选择用例

nosetests test.module
nosetests another.test:TestCase.test_method
nosetests a.test:TestCase
nosetests /path/to/test/file.py:test_function

nosetests -w /path/to/tests

nosetests /path/to/tests /another/path/to/tests


选项

-m=REGEX, --match=REGEX, --testmatch=REGEX
Files, directories, function names, and class names that match this regular expression are considered tests. 
Default: (?:^|[b_./-])[Tt]est 


-I=REGEX, --ignore-files=REGEX
Completely ignore any file that matches this regular expression. Takes precedence over any other settings or plugins. Specifying this option will replace the default setting. Specify this option multiple times to add more regular expressions 


--debug-log=FILE
Log debug messages to this file (default: sys.stderr)


-a=ATTR, --attr=ATTR
Run only tests that have attributes specified by ATTR 


-s, --nocapture
Don’t capture stdout (any stdout output will be printed immediately)


--with-coverage
Enable plugin Coverage: Activate a coverage report using Ned Batchelder’s coverage module. 


--no-skip
Disable special handling of SkipTest exceptions.


--failed
Run the tests that failed in the last test run.


--collect-only
Enable collect-only: Collect and output test names only, don’t run any tests. 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值