66from 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
1616pytestmark = 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