def calc_mul_1(self, a, b): try: self.demo1 = demo1() result = self.demo1.mul(a, b) print(result) assert (a * b) == result except ValueError as e: assert False print(e)
def test_div_1(self, a, b): try: self.demo1 = demo1() result = self.demo1.div(a, b) print(result) assert (a / b) == result except ValueError as e: assert False print(e)
def calc_div_1(self, a, b): try: self.demo1 = demo1() result = self.demo1.div(a, b) print(result) assert (a / b) == result except ZeroDivisionError as e: assert False print(e) except ValueError as e: assert False print(e)
def calc_sub_1(self, a, b): try: self.demo1 = demo1() result = self.demo1.sub(a, b) print(result) assert (a - b) == result except ValueError as e: assert False print(e) # if __name__ == '__main__': # pytest.main()
def test_add_1(self, a, b): self.demo1 = demo1() result = self.demo1.add(a, b) print(result) assert (a + b) == result