在setup()中输出pyunit测试名称的方法

2024-06-16 11:05:12 发布

您现在位置:Python中文网/ 问答频道 /正文

python中是否有方法让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))

Tags: 方法debugtestselflog示例exampledef