1个回答
展开全部
真搞不懂,这类不对,这调用也不对,不知这是闹哪般?
import unittest
class ArithTest(unittest.TestCase):
def runTest(self):
self.failUnless(1+1==2,'one plus one fails')
self.failIf(1+1!=2,'one plus one again')
self.failUnlessEqual(1+1,2,'more trouble')
def suite():
suite = unittest.TestSuite()
suite.addTest(ArithTest())
return suite
if __name__ == '__main__':
runner = unittest.TextTestRunner()
test_suite = suite()
runner.run(test_suite)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询