def METHOD_NAME():
    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter("always")
        val = ensure_type(a, np.float64, 1, '', length=10, warn_on_cast=False)
        assert val.dtype == np.float64
        assert a.dtype == np.float32  # a should not be changed
        assert len(w) == 0  # no warning since we set warn_on_cast to False