def test_sine(): # a sine curve from zero to pi -- should be 2 # with a hundred points, only correct to about 4 figures assert isclose(trapz(math.sin, 0, math.pi), 2.0, rel_tol=1e-04)