- 全局
setup_module(module)
/teardown_module(module)
引入包的时候执行setup_function(function)
/teardown_function(function)
- 模块级别
setup()
/teardown()
测试模块载入的时候执行
- 类级别
setup_class(cls)
/teardown_class(cls)
setup_method(self, method)
/teardown_method(self, method)
setup(self)
/teardown(self)
nose 语法,会被上面两个方法覆盖
Supported nose Idioms
setup()
andteardown()
at module/class/method level: any function or method calledsetup
will be called during the setup phase for each test, same forteardown
.SkipTest
exceptions and markers- setup/teardown decorators
__test__
attribute on modules/classes/functions- general usage of nose utilities