@@ -231,7 +231,7 @@ def test_orc_reader_snappy_compressed(dirpath):
231
231
tm .assert_equal (expected , got )
232
232
233
233
234
- def test_orc_roundtrip_file (dirpath ):
234
+ def test_orc_roundtrip_file (dirpath , temp_file ):
235
235
# GH44554
236
236
# PyArrow gained ORC write support with the current argument order
237
237
pytest .importorskip ("pyarrow" )
@@ -249,11 +249,11 @@ def test_orc_roundtrip_file(dirpath):
249
249
}
250
250
expected = pd .DataFrame .from_dict (data )
251
251
252
- with tm . ensure_clean () as path :
253
- expected .to_orc (path )
254
- got = read_orc (path )
252
+ path = str ( temp_file )
253
+ expected .to_orc (path )
254
+ got = read_orc (path )
255
255
256
- tm .assert_equal (expected , got )
256
+ tm .assert_equal (expected , got )
257
257
258
258
259
259
def test_orc_roundtrip_bytesio ():
@@ -383,12 +383,12 @@ def test_orc_dtype_backend_numpy_nullable():
383
383
tm .assert_frame_equal (result , expected )
384
384
385
385
386
- def test_orc_uri_path ():
386
+ def test_orc_uri_path (temp_file ):
387
387
expected = pd .DataFrame ({"int" : list (range (1 , 4 ))})
388
- with tm . ensure_clean ( "tmp.orc" ) as path :
389
- expected .to_orc (path )
390
- uri = pathlib .Path (path ).as_uri ()
391
- result = read_orc (uri )
388
+ path = str ( temp_file )
389
+ expected .to_orc (path )
390
+ uri = pathlib .Path (path ).as_uri ()
391
+ result = read_orc (uri )
392
392
tm .assert_frame_equal (result , expected )
393
393
394
394
@@ -410,16 +410,16 @@ def test_to_orc_non_default_index(index):
410
410
df .to_orc ()
411
411
412
412
413
- def test_invalid_dtype_backend ():
413
+ def test_invalid_dtype_backend (temp_file ):
414
414
msg = (
415
415
"dtype_backend numpy is invalid, only 'numpy_nullable' and "
416
416
"'pyarrow' are allowed."
417
417
)
418
418
df = pd .DataFrame ({"int" : list (range (1 , 4 ))})
419
- with tm . ensure_clean ( "tmp.orc" ) as path :
420
- df .to_orc (path )
421
- with pytest .raises (ValueError , match = msg ):
422
- read_orc (path , dtype_backend = "numpy" )
419
+ path = str ( temp_file )
420
+ df .to_orc (path )
421
+ with pytest .raises (ValueError , match = msg ):
422
+ read_orc (path , dtype_backend = "numpy" )
423
423
424
424
425
425
def test_string_inference (tmp_path ):
0 commit comments