Skip to content

Commit 8d32d57

Browse files
TST: Replace ensure_clean_store with temp_file in test_time_series.py (#62652)
Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
1 parent aa7d1d4 commit 8d32d57

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pandas/tests/io/pytables/test_time_series.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@
66
from pandas import (
77
DataFrame,
88
DatetimeIndex,
9+
HDFStore,
910
Series,
1011
_testing as tm,
1112
date_range,
1213
period_range,
1314
)
14-
from pandas.tests.io.pytables.common import ensure_clean_store
1515

1616
pytestmark = pytest.mark.single_cpu
1717

1818

1919
@pytest.mark.parametrize("unit", ["us", "ns"])
20-
def test_store_datetime_fractional_secs(setup_path, unit):
20+
def test_store_datetime_fractional_secs(temp_file, unit):
2121
dt = datetime.datetime(2012, 1, 2, 3, 4, 5, 123456)
2222
dti = DatetimeIndex([dt], dtype=f"M8[{unit}]")
2323
series = Series([0], index=dti)
24-
with ensure_clean_store(setup_path) as store:
24+
with HDFStore(temp_file) as store:
2525
store["a"] = series
2626
assert store["a"].index[0] == dt
2727

2828

2929
@pytest.mark.filterwarnings(r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning")
30-
def test_tseries_indices_series(setup_path):
31-
with ensure_clean_store(setup_path) as store:
30+
def test_tseries_indices_series(temp_file):
31+
with HDFStore(temp_file) as store:
3232
idx = date_range("2020-01-01", periods=10)
3333
ser = Series(np.random.default_rng(2).standard_normal(len(idx)), idx)
3434
store["a"] = ser
@@ -49,8 +49,8 @@ def test_tseries_indices_series(setup_path):
4949

5050

5151
@pytest.mark.filterwarnings(r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning")
52-
def test_tseries_indices_frame(setup_path):
53-
with ensure_clean_store(setup_path) as store:
52+
def test_tseries_indices_frame(temp_file):
53+
with HDFStore(temp_file) as store:
5454
idx = date_range("2020-01-01", periods=10)
5555
df = DataFrame(
5656
np.random.default_rng(2).standard_normal((len(idx), 3)), index=idx

0 commit comments

Comments
 (0)