#5 Pytest setup 和 teardown 方法
Python 测试 pytest 2022-07-12- 全局
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 calledsetupwill be called during the setup phase for each test, same forteardown.SkipTestexceptions and markers- setup/teardown decorators
__test__attribute on modules/classes/functions- general usage of nose utilities

