鼻selecttests是鼻子插件来指定白名单的关键字进行测试通过鼻子来运行。
用法
使用上的插件包本身的插件的例子:
运行所有测试:
$ nosetests -v
test_configure_complex(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_empty_string(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_none(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_simple(noseselecttests.tests.NoseSelectPluginTest)... OK
test_is_selected_case_insensitive(noseselecttests.tests.NoseSelectPluginTest)... OK
test_is_selected_negative(noseselecttests.tests.NoseSelectPluginTest)... OK
test_is_selected_simple(noseselecttests.tests.NoseSelectPluginTest)... OK
test_is_selected_unselected(noseselecttests.tests.NoseSelectPluginTest)... OK
test_is_selected_unselected_override(noseselecttests.tests.NoseSelectPluginTest)... OK
test_is_selected_wildcard(noseselecttests.tests.NoseSelectPluginTest)... OK
test_options(noseselecttests.tests.NoseSelectPluginTest)... OK
test_prepareTestCase_exclude(noseselecttests.tests.NoseSelectPluginTest)... OK
test_prepareTestCase_select(noseselecttests.tests.NoseSelectPluginTest)... OK
-------------------------------------------------- --------------------
跑了13个测试0.008s
行
只运行与关键字配置测试:
$ nosetests -v -t配置
test_configure_complex(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_empty_string(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_none(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_simple(noseselecttests.tests.NoseSelectPluginTest)... OK
-------------------------------------------------- --------------------
跑了4次测试中0.006s
行
不区分大小写:
$ nosetests -v -t CONFIGURE
test_configure_complex(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_empty_string(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_none(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_simple(noseselecttests.tests.NoseSelectPluginTest)... OK
-------------------------------------------------- --------------------
跑了4次测试中0.006s
行
只运行与关键字配置测试,但不包括与关键字复杂的测试:
$ nosetests -v -t配置-e复杂
test_configure_empty_string(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_none(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_simple(noseselecttests.tests.NoseSelectPluginTest)... OK
-------------------------------------------------- --------------------
跑了3次测试中0.006s
行
只是排除了一些测试,使用-e这是由鼻子本身提供:
$ nosetests -v -e is_selected
test_configure_complex(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_empty_string(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_none(noseselecttests.tests.NoseSelectPluginTest)... OK
test_configure_simple(noseselecttests.tests.NoseSelectPluginTest)... OK
test_options(noseselecttests.tests.NoseSelectPluginTest)... OK
test_prepareTestCase_exclude(noseselecttests.tests.NoseSelectPluginTest)... OK
test_prepareTestCase_select(noseselecttests.tests.NoseSelectPluginTest)... OK
-------------------------------------------------- --------------------
在0.005s跑了7测试
OK
要求:
- 在Python中
- 在鼻子
评论没有发现