Skip to content

Commit 754b8a9

Browse files
committed
rewrite tests using tz_aware_fixture
1 parent b5966e5 commit 754b8a9

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

pandas/tests/io/pytables/test_timezones.py

+15-6
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,11 @@ def test_timezones_fixed_format_frame_non_empty(setup_path):
296296
tm.assert_frame_equal(result, df)
297297

298298

299-
@pytest.mark.parametrize("dtype", ["datetime64[ns, UTC]", "datetime64[ns, US/Eastern]"])
300-
def test_timezones_fixed_format_frame_empty(setup_path, dtype):
299+
def test_timezones_fixed_format_frame_empty(setup_path, tz_aware_fixture):
300+
# GH 20594
301+
302+
dtype = pd.DatetimeTZDtype(tz=tz_aware_fixture)
303+
301304
with ensure_clean_store(setup_path) as store:
302305
s = Series(dtype=dtype)
303306
df = DataFrame({"A": s})
@@ -306,17 +309,23 @@ def test_timezones_fixed_format_frame_empty(setup_path, dtype):
306309
tm.assert_frame_equal(result, df)
307310

308311

309-
@pytest.mark.parametrize("dtype", ["datetime64[ns, UTC]", "datetime64[ns, US/Eastern]"])
310-
def test_timezones_fixed_format_series_nonempty(setup_path, dtype):
312+
def test_timezones_fixed_format_series_nonempty(setup_path, tz_aware_fixture):
313+
# GH 20594
314+
315+
dtype = pd.DatetimeTZDtype(tz=tz_aware_fixture)
316+
311317
with ensure_clean_store(setup_path) as store:
312318
s = Series([0], dtype=dtype)
313319
store["s"] = s
314320
result = store["s"]
315321
tm.assert_series_equal(result, s)
316322

317323

318-
@pytest.mark.parametrize("dtype", ["datetime64[ns, UTC]", "datetime64[ns, US/Eastern]"])
319-
def test_timezones_fixed_format_series_empty(setup_path, dtype):
324+
def test_timezones_fixed_format_series_empty(setup_path, tz_aware_fixture):
325+
# GH 20594
326+
327+
dtype = pd.DatetimeTZDtype(tz=tz_aware_fixture)
328+
320329
with ensure_clean_store(setup_path) as store:
321330
s = Series(dtype=dtype)
322331
store["s"] = s

0 commit comments

Comments
 (0)