所以我有一个脚本 test.py
from nose.tools import with_setup
class Test:
@with_setup(setup_func, teardown_func)
def test(self):
print "Hello World"
我可以在与“test.py”相同的目录中的init .py 中定义 setup_func() 和 teardown_func()。
基本上,目标是为一堆测试用例进行通用设置和拆卸。