Skip to content

Commit f3f8d4f

Browse files
committed
prepare conftest for pandas-dev#25637
1 parent 7f31865 commit f3f8d4f

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

pandas/conftest.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -376,19 +376,25 @@ def unique_nulls_fixture(request):
376376
FixedOffset(0), FixedOffset(-300), timezone.utc,
377377
timezone(timedelta(hours=1)),
378378
timezone(timedelta(hours=-1), name='foo')]
379+
TIMEZONE_IDS = ['None', 'UTC', 'US/Eastern', 'Asia/Tokyp',
380+
'dateutil/US/Pacific', 'dateutil/Asia/Singapore',
381+
'dateutil.tz.tzutz()', 'dateutil.tz.tzlocal()',
382+
'pytz.FixedOffset(300)', 'pytz.FixedOffset(0)',
383+
'pytz.FixedOffset(-300)', 'datetime.timezone.utc',
384+
'datetime.timezone.+1', 'datetime.timezone.-1.named']
379385

380386

381-
@td.parametrize_fixture_doc(str(TIMEZONES))
382-
@pytest.fixture(params=TIMEZONES)
387+
@td.parametrize_fixture_doc(str(TIMEZONE_IDS))
388+
@pytest.fixture(params=TIMEZONES, ids=TIMEZONE_IDS)
383389
def tz_naive_fixture(request):
384390
"""
385391
Fixture for trying timezones including default (None): {0}
386392
"""
387393
return request.param
388394

389395

390-
@td.parametrize_fixture_doc(str(TIMEZONES[1:]))
391-
@pytest.fixture(params=TIMEZONES[1:])
396+
@td.parametrize_fixture_doc(str(TIMEZONE_IDS[1:]))
397+
@pytest.fixture(params=TIMEZONES[1:], ids=TIMEZONE_IDS[1:])
392398
def tz_aware_fixture(request):
393399
"""
394400
Fixture for trying explicit timezones: {0}
@@ -409,16 +415,16 @@ def tz_aware_fixture(request):
409415
COMPLEX_DTYPES = [complex, "complex64", "complex128"]
410416
STRING_DTYPES = [str, 'str', 'U']
411417

412-
DATETIME_DTYPES = ['datetime64[ns]', 'M8[ns]']
413-
TIMEDELTA_DTYPES = ['timedelta64[ns]', 'm8[ns]']
418+
DATETIME64_DTYPES = ['datetime64[ns]', 'M8[ns]']
419+
TIMEDELTA64_DTYPES = ['timedelta64[ns]', 'm8[ns]']
414420

415421
BOOL_DTYPES = [bool, 'bool']
416422
BYTES_DTYPES = [bytes, 'bytes']
417423
OBJECT_DTYPES = [object, 'object']
418424

419425
ALL_REAL_DTYPES = FLOAT_DTYPES + ALL_INT_DTYPES
420426
ALL_NUMPY_DTYPES = (ALL_REAL_DTYPES + COMPLEX_DTYPES + STRING_DTYPES +
421-
DATETIME_DTYPES + TIMEDELTA_DTYPES + BOOL_DTYPES +
427+
DATETIME64_DTYPES + TIMEDELTA64_DTYPES + BOOL_DTYPES +
422428
OBJECT_DTYPES + BYTES_DTYPES)
423429

424430

0 commit comments

Comments
 (0)