标签:sim from mic aqi 地址 理解 nvl ajp name
import unittest class myTest(unittest.TestCase): def setUp(self): print("前置测试条件") def tearDown(self): print("后置测试条件") def test02(self): print("普通方法1") def test01(self): print("普通方法2") if __name__ == ‘__main__‘: unittest.main()
import unittest class myTest(unittest.TestCase): def test_f1(self): print("普通方法1") def test_f2(self): print("普通方法2") def test_f3(self): print("普通方法3") if __name__ == ‘__main__‘: suite=unittest.TestSuite() suite.addTest(myTest("test_f1")) suite.addTest(myTest("test_f2")) suite.addTest(myTest("test_f3")) unittest.TextTestRunner().run(suite)
import unittest class myTest(unittest.TestCase): def test_c(self): print("普通方法1") def test_b(self): print("普通方法2") def test_a(self): print("普通方法3") if __name__ == ‘__main__‘: suite=unittest.TestSuite() suite.addTest(myTest("test_c")) suite.addTest(myTest("test_b")) suite.addTest(myTest("test_a")) unittest.TextTestRunner().run(suite)
import unittest class myTest(unittest.TestCase): def test_01(self): print("普通方法1") def test_02(self): print("普通方法2") def test_03(self): print("普通方法3") if __name__ == ‘__main__‘: suite=unittest.TestSuite(unittest.makesuite(myTest)) unittest.TextTestRunner().run(suite)
import unittest class myTest(unittest.TestCase): def test_01(self): print("普通方法1") def test_02(self): print("普通方法2") def test_03(self): print("普通方法3") class myTest02(unittest.TestCase): def test_mytest01(self): print("类test_mytest01的方法01") def test_mytest02(self): print("类test_mytest01的方法02") if __name__ == ‘__main__‘: suite=unittest.TestLoader().loadTestsFromModule("unit01.py") unittest.TextTestRunner(verbosity=2).run(suite)
标签:sim from mic aqi 地址 理解 nvl ajp name
原文地址:https://www.cnblogs.com/Qliupeng/p/11913335.html