def test_div_par(number1, number2, number3): assert div1(number1, number2) == number3
def test_div_error(): # 预期为异常需要用到该语句 with pytest.raises(ZeroDivisionError): div1(10, 0)
def test_div_float(): assert div1(100.8, 2) == 50.4
def test_div_type(): assert div1('aa', 123) == 0
def test_div_int(): assert div1(10, 2) == 5