{lamb} nosetests -v -s Testexec.py Testexec.TestClass.test_Fun1 ... =============-My Testcase is setup-=========== This is test_Fun1***====*** ============My Testcase is teardown=========== ok Testexec.TestClass.test_fun1 ... =============-My Testcase is setup-=========== This is test_fun1******* ============My Testcase is teardown=========== ok Testexec.TestClass.test_fun2 ... =============-My Testcase is setup-=========== This is test_fun2===== ============My Testcase is teardown=========== ok Testexec.TestClass.test_fun3 ... =============-My Testcase is setup-=========== This is test_fun3~~~~~~~~~ ============My Testcase is teardown=========== SKIP ---------------------------------------------------------------------- Ran 4 tests in 0.005s OK (SKIP=1)
{lamb} nosetests -v -s Testexec.py 只初始化一次setup======= Testexec.TestClass.test_Fun1 ... =============-My Testcase is setup-=========== This is test_Fun1***====*** ============My Testcase is teardown=========== ok Testexec.TestClass.test_fun1 ... =============-My Testcase is setup-=========== This is test_fun1******* ============My Testcase is teardown=========== ok Testexec.TestClass.test_fun2 ... =============-My Testcase is setup-=========== This is test_fun2===== ============My Testcase is teardown=========== ok Testexec.TestClass.test_fun3 ... =============-My Testcase is setup-=========== This is test_fun3~~~~~~~~~ ============My Testcase is teardown=========== SKIP 只teardown一次*********** ---------------------------------------------------------------------- Ran 4 tests in 0.006s OK (SKIP=1)