Pyunit測試是否有一種方法輸出當前正在運行的測試。例如:在setup()中輸出pyunit測試名的一種方法
def setUp(self):
log.debug("Test %s Started" % (testname))
def test_example(self):
#do stuff
def test_example2(self):
#do other stuff
def tearDown(self):
log.debug("Test %s Finished" % (testname))
這是類名,而不是方法的名稱,再加上他試圖把它放在`setUp`和`tearDown`中,而不是在方法本身中。 – 2010-12-21 23:09:52
正確。需要setUp和tearDown中的方法名稱。謝謝丹尼爾 – 2010-12-21 23:14:49