def test_integrate_trapz_failure(): with pytest.raises(Exception): integrate_trapz("Some", "Values")
def test_integrate_trapz_1(): xs, ys = np.linspace(0, 10, 11), np.linspace(0, 10, 11) assert integrate_trapz(xs, ys) == 50
def test_integrate_trapz_1(): xs, ys = np.linspace(0, 10, 10), np.zeros(10) assert integrate_trapz(xs, ys) == 0
def test_integrate_trapz_failure(): with pytest.raises(Exception): integrate_trapz("Some", "Values") # some arbitrary change to force a commit push to test travis
def test_integrate_trapz_2(): xs, ys = np.linspace(0, 10, 10), np.linspace(0, 10, 10) assert integrate_trapz(xs, ys) != 0
def test_integrate_trapz_tri(): width = 10 slope = 2 xs = np.linspace(0, width, 10) ys = np.array([slope * x for x in xs]) assert integrate_trapz(xs, ys) == 0.5 * width * (slope * width)
def test_integrate_trapz_2(): width = 10 height = 1 xs, ys = np.linspace(0, width, 10), np.zeros(10) + height assert integrate_trapz(xs, ys) == width * height