From 4449a77efeb5929ecee63b6daf38d5f1b254d319 Mon Sep 17 00:00:00 2001 From: hulusierin Date: Tue, 7 Oct 2025 16:02:56 +0100 Subject: [PATCH 1/2] TST: Replace ensure_clean with temp_file in test_errors.py --- pandas/tests/io/pytables/test_errors.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandas/tests/io/pytables/test_errors.py b/pandas/tests/io/pytables/test_errors.py index 23932b6092998..e6733df921e58 100644 --- a/pandas/tests/io/pytables/test_errors.py +++ b/pandas/tests/io/pytables/test_errors.py @@ -182,16 +182,16 @@ def test_append_with_diff_col_name_types_raises_value_error(setup_path): store.append(name, d) -def test_invalid_complib(setup_path): +def test_invalid_complib(tmp_path, setup_path): df = DataFrame( np.random.default_rng(2).random((4, 5)), index=list("abcd"), columns=list("ABCDE"), ) - with tm.ensure_clean(setup_path) as path: - msg = r"complib only supports \[.*\] compression." - with pytest.raises(ValueError, match=msg): - df.to_hdf(path, key="df", complib="foolib") + path = tmp_path / setup_path + msg = r"complib only supports \[.*\] compression." + with pytest.raises(ValueError, match=msg): + df.to_hdf(path, key="df", complib="foolib") @pytest.mark.parametrize( From 3322a7a9f6be01263d516ec0a1be12d37c3d84bc Mon Sep 17 00:00:00 2001 From: hulusierin Date: Tue, 7 Oct 2025 16:11:42 +0100 Subject: [PATCH 2/2] Fix formatting with pre-commit --- pandas/tests/io/pytables/test_errors.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/tests/io/pytables/test_errors.py b/pandas/tests/io/pytables/test_errors.py index e6733df921e58..37e6eeb05deec 100644 --- a/pandas/tests/io/pytables/test_errors.py +++ b/pandas/tests/io/pytables/test_errors.py @@ -11,7 +11,6 @@ HDFStore, Index, MultiIndex, - _testing as tm, date_range, read_hdf, )