标签:模块 方法 def imp The 继承 elf class const
import unittest class TestDict(unittest.TestCase):
引用unitest模块,然后定义一个测试类,继承unitest.TestCase。
方法测试前置操作setup
def setUp(self): # Hook method for setting up the test fixture before exercising it. print(‘每次执行都先经过我‘)
方法测试后置操作
def tearDown(self): # Hook method for deconstructing the test fixture after testing it. print(‘每次结束前执行‘)
标签:模块 方法 def imp The 继承 elf class const
原文地址:https://www.cnblogs.com/jmwmj/p/9032936.html