def test_case3(self): result = add(1, '1') # 程序会抛出error,error表示代码有错误 self.assertEqual(result, 2)
def test_case2(self): result = add(1, 1) self.assertEqual(result, 3) # 程序会抛出fail,fail表示断言失败
def test_case3(self): result = add(2.1, 3.2) self.assertEqual(result, 4)
def test_case1(self): result = add(1, 1) self.assertEqual(result, 2)
def test_case2(self): result = add(2, 3) self.assertEqual(result, 4)