Skip to content

Commit 5038892

Browse files
HulusiOzyJustine Wezenaar
authored andcommitted
TST: Replace ensure_clean with temp_file in test_errors.py (pandas-dev#62612)
1 parent ec842ce commit 5038892

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pandas/tests/io/pytables/test_errors.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
HDFStore,
1212
Index,
1313
MultiIndex,
14-
_testing as tm,
1514
date_range,
1615
read_hdf,
1716
)
@@ -182,16 +181,16 @@ def test_append_with_diff_col_name_types_raises_value_error(setup_path):
182181
store.append(name, d)
183182

184183

185-
def test_invalid_complib(setup_path):
184+
def test_invalid_complib(tmp_path, setup_path):
186185
df = DataFrame(
187186
np.random.default_rng(2).random((4, 5)),
188187
index=list("abcd"),
189188
columns=list("ABCDE"),
190189
)
191-
with tm.ensure_clean(setup_path) as path:
192-
msg = r"complib only supports \[.*\] compression."
193-
with pytest.raises(ValueError, match=msg):
194-
df.to_hdf(path, key="df", complib="foolib")
190+
path = tmp_path / setup_path
191+
msg = r"complib only supports \[.*\] compression."
192+
with pytest.raises(ValueError, match=msg):
193+
df.to_hdf(path, key="df", complib="foolib")
195194

196195

197196
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)