From 0207831b1adaa3d793273abc4afe94da87d444e7 Mon Sep 17 00:00:00 2001 From: hulusierin Date: Tue, 7 Oct 2025 16:24:17 +0100 Subject: [PATCH] TST: Replace ensure_clean with temp_file in test_pytables_missing.py --- pandas/tests/io/pytables/test_pytables_missing.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandas/tests/io/pytables/test_pytables_missing.py b/pandas/tests/io/pytables/test_pytables_missing.py index 8d9d3afc4ad6f..b46028f936e94 100644 --- a/pandas/tests/io/pytables/test_pytables_missing.py +++ b/pandas/tests/io/pytables/test_pytables_missing.py @@ -3,12 +3,11 @@ import pandas.util._test_decorators as td import pandas as pd -import pandas._testing as tm @td.skip_if_installed("tables") -def test_pytables_raises(): +def test_pytables_raises(tmp_path): df = pd.DataFrame({"A": [1, 2]}) + path = tmp_path / "foo.h5" with pytest.raises(ImportError, match="tables"): - with tm.ensure_clean("foo.h5") as path: - df.to_hdf(path, key="df") + df.to_hdf(path, key="df")