test suite
- 测试套件,理解成测试用例集
- 一系列的测试用例,或测试套件,理解成测试用例的集合和测试套件的集合
- 当运行测试套件时,则运行里面添加的所有测试用例
test runner
- 测试运行器
- 用于执行和输出结果的组件
test suite、test runner基础使用
单元测试类
1 # 创建单元测试类,继承unittest.TestCase 2 class testCase(unittest.TestCase): 3 4 # 测试case 5 def test_01(self): 6 print("test01") 7 8 def test_03(self): 9 print("test03") 10 11 def test_04(self): 12 print("test04") 13 14 def test_05(self): 15 print("test05")
主函数
1 if __name__ == '__main__': 2 # 实例化测试套件