Skip to content

Commit 9b10519

Browse files
committed
TST: replace ensure_clean with tmp_path
1 parent 318c605 commit 9b10519

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/tests/io/parser/common/test_common_basic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -785,15 +785,15 @@ def test_dict_keys_as_names(all_parsers):
785785

786786
@pytest.mark.xfail(using_string_dtype() and HAS_PYARROW, reason="TODO(infer_string)")
787787
@xfail_pyarrow # UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 0
788-
def test_encoding_surrogatepass(all_parsers, temp_file):
788+
def test_encoding_surrogatepass(all_parsers, tmp_path):
789789
# GH39017
790790
parser = all_parsers
791791
content = b"\xed\xbd\xbf"
792792
decoded = content.decode("utf-8", errors="surrogatepass")
793793
expected = DataFrame({decoded: [decoded]}, index=[decoded * 2])
794794
expected.index.name = decoded * 2
795795

796-
path = temp_file
796+
path = tmp_path / "test_encoding.csv"
797797
path.write_bytes(
798798
content * 2 + b"," + content + b"\n" + content * 2 + b"," + content
799799
)
@@ -834,12 +834,12 @@ def test_short_multi_line(all_parsers):
834834
tm.assert_frame_equal(result, expected)
835835

836836

837-
def test_read_seek(all_parsers, temp_file):
837+
def test_read_seek(all_parsers, tmp_path):
838838
# GH48646
839839
parser = all_parsers
840840
prefix = "### DATA\n"
841841
content = "nkey,value\ntables,rectangular\n"
842-
path = temp_file
842+
path = tmp_path / "test_seek.csv"
843843
path.write_text(prefix + content, encoding="utf-8")
844844
with open(path, encoding="utf-8") as file:
845845
file.readline()

0 commit comments

Comments
 (0)