From f4e42c5ecf70514203d6c62ce517d80e352b3681 Mon Sep 17 00:00:00 2001 From: Lu Yibo <1478354316@qq.com> Date: Thu, 30 Oct 2025 19:07:24 +0800 Subject: [PATCH 1/2] replace ensure_clean with temp_file in pandas/tests/io/sas/test_sas.py replace ensure_clean with temp_file in pandas/tests/io/sas/test_sas.py --- pandas/tests/io/sas/test_sas.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/tests/io/sas/test_sas.py b/pandas/tests/io/sas/test_sas.py index 1e38baf4fc409..6fc4583392eb5 100644 --- a/pandas/tests/io/sas/test_sas.py +++ b/pandas/tests/io/sas/test_sas.py @@ -18,12 +18,12 @@ def test_sas_buffer_format(self): with pytest.raises(ValueError, match=msg): read_sas(b) - def test_sas_read_no_format_or_extension(self): + def test_sas_read_no_format_or_extension(self, temp_file): # see gh-24548 msg = "unable to infer format of SAS file.+" - with tm.ensure_clean("test_file_no_extension") as path: - with pytest.raises(ValueError, match=msg): - read_sas(path) + # Using the pytest temp_file fixture instead of tm.ensure_clean + with pytest.raises(ValueError, match=msg): + read_sas(temp_file) def test_sas_archive(datapath): From 4872bc03874d601617cf55724e9b7e5b34b1f1ee Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Thu, 30 Oct 2025 09:00:16 -0700 Subject: [PATCH 2/2] Update pandas/tests/io/sas/test_sas.py --- pandas/tests/io/sas/test_sas.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/tests/io/sas/test_sas.py b/pandas/tests/io/sas/test_sas.py index 6fc4583392eb5..ea072b6e9c4e0 100644 --- a/pandas/tests/io/sas/test_sas.py +++ b/pandas/tests/io/sas/test_sas.py @@ -21,7 +21,6 @@ def test_sas_buffer_format(self): def test_sas_read_no_format_or_extension(self, temp_file): # see gh-24548 msg = "unable to infer format of SAS file.+" - # Using the pytest temp_file fixture instead of tm.ensure_clean with pytest.raises(ValueError, match=msg): read_sas(temp_file)