def check_error_on_write(self, df, exc): # check that we are raising the exception # on writing with pytest.raises(exc): with tm.ensure_clean() as path: to_feather(df, path)
def check_external_error_on_write(self, df): # check that we are raising the exception # on writing with tm.external_error_raised(Exception): with tm.ensure_clean() as path: to_feather(df, path)
def check_round_trip(self, df, **kwargs): with ensure_clean() as path: to_feather(df, path) result = read_feather(path, **kwargs) assert_frame_equal(result, df)
def check_error_on_write(self, df, exc): # check that we are raising the exception # on writing with pytest.raises(exc): with ensure_clean() as path: to_feather(df, path)
def check_round_trip(self, df, **kwargs): with ensure_clean() as path: to_feather(df, path) with catch_warnings(record=True): result = read_feather(path, **kwargs) assert_frame_equal(result, df)
def check_round_trip(self, df, expected=None, write_kwargs={}, **read_kwargs): if expected is None: expected = df with tm.ensure_clean() as path: to_feather(df, path, **write_kwargs) result = read_feather(path, **read_kwargs) tm.assert_frame_equal(result, expected)
def check_round_trip(self, df, expected=None, **kwargs): if expected is None: expected = df with ensure_clean() as path: to_feather(df, path) result = read_feather(path, **kwargs) assert_frame_equal(result, expected)
def f(): with ensure_clean() as path: to_feather(df, path)