'Test newton_cotes with points that are not evenly spaced.'

def test_newton_cotes2(self):

    x = np.array([0.0, 1.5, 2.0])
    y = (x ** 2)
    (wts, errcoff) = newton_cotes(x)
    exact_integral = (8.0 / 3)
    numeric_integral = np.dot(wts, y)
    assert_almost_equal(numeric_integral, exact_integral)
    x = np.array([0.0, 1.4, 2.1, 3.0])
    y = (x ** 2)
    (wts, errcoff) = newton_cotes(x)
    exact_integral = 9.0
    numeric_integral = np.dot(wts, y)
    assert_almost_equal(numeric_integral, exact_integral)
