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:372–392  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

370
371@pytest.mark.pandas
372def test_delete_partial_file_on_error(version):
373 if sys.platform == 'win32':
374 pytest.skip('Windows hangs on to file handle for some reason')
375
376 class CustomClass:
377 pass
378
379 # strings will fail
380 df = pd.DataFrame(
381 {
382 'numbers': range(5),
383 'strings': [b'foo', None, 'bar', CustomClass(), np.nan]},
384 columns=['numbers', 'strings'])
385
386 path = random_path()
387 try:
388 write_feather(df, path, version=version)
389 except Exception:
390 pass
391
392 assert not os.path.exists(path)
393
394
395@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