Skip to content

Commit 0742698

Browse files
committed
test_orc updated
1 parent 204369b commit 0742698

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

pandas/tests/io/test_orc.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def test_orc_reader_snappy_compressed(dirpath):
231231
tm.assert_equal(expected, got)
232232

233233

234-
def test_orc_roundtrip_file(dirpath):
234+
def test_orc_roundtrip_file(dirpath, temp_file):
235235
# GH44554
236236
# PyArrow gained ORC write support with the current argument order
237237
pytest.importorskip("pyarrow")
@@ -249,11 +249,11 @@ def test_orc_roundtrip_file(dirpath):
249249
}
250250
expected = pd.DataFrame.from_dict(data)
251251

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)
255255

256-
tm.assert_equal(expected, got)
256+
tm.assert_equal(expected, got)
257257

258258

259259
def test_orc_roundtrip_bytesio():
@@ -383,12 +383,12 @@ def test_orc_dtype_backend_numpy_nullable():
383383
tm.assert_frame_equal(result, expected)
384384

385385

386-
def test_orc_uri_path():
386+
def test_orc_uri_path(temp_file):
387387
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)
392392
tm.assert_frame_equal(result, expected)
393393

394394

@@ -410,16 +410,16 @@ def test_to_orc_non_default_index(index):
410410
df.to_orc()
411411

412412

413-
def test_invalid_dtype_backend():
413+
def test_invalid_dtype_backend(temp_file):
414414
msg = (
415415
"dtype_backend numpy is invalid, only 'numpy_nullable' and "
416416
"'pyarrow' are allowed."
417417
)
418418
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")
423423

424424

425425
def test_string_inference(tmp_path):

0 commit comments

Comments
 (0)