MCPcopy Create free account
hub / github.com/apache/arrow / test_delete_partial_file_on_error

Function test_delete_partial_file_on_error

python/pyarrow/tests/test_feather.py:379–399  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

377
378@pytest.mark.pandas
379def test_delete_partial_file_on_error(version):
380 if sys.platform == 'win32':
381 pytest.skip('Windows hangs on to file handle for some reason')
382
383 class CustomClass:
384 pass
385
386 # strings will fail
387 df = pd.DataFrame(
388 {
389 'numbers': range(5),
390 'strings': [b'foo', None, 'bar', CustomClass(), np.nan]},
391 columns=['numbers', 'strings'])
392
393 path = random_path()
394 try:
395 write_feather(df, path, version=version)
396 except Exception:
397 pass
398
399 assert not os.path.exists(path)
400
401
402@pytest.mark.pandas

Callers

nothing calls this directly

Calls 3

write_featherFunction · 0.90
random_pathFunction · 0.85
CustomClassClass · 0.70

Tested by

no test coverage detected