def test_check_exog_infinite_value_err(arr): with pytest.raises(ValueError): check_exog(arr, force_all_finite=True) # show it passes when False assert check_exog( arr, force_all_finite=False, dtype=None, copy=False) is arr
def test_exog_np_array(): X_np = np.random.RandomState(1).rand(5, 5) # show works on a list assert_array_almost_equal(X_np, check_exog(X_np.tolist())) assert_array_almost_equal(X_np, check_exog(X_np))
def test_exog_pd_dataframes(): # test with copy assert check_exog(X, force_all_finite=True, copy=True).equals(X) # test without copy assert check_exog(X, force_all_finite=True, copy=False) is X
def test_check_exog_ndim_value_err(arr): with pytest.raises(ValueError): check_exog(arr)