Skip to content

Commit

Permalink
prepare conftest for pandas-dev#25637
Browse files Browse the repository at this point in the history
  • Loading branch information
h-vetinari committed May 31, 2019
1 parent 7f31865 commit f3f8d4f
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,19 +376,25 @@ def unique_nulls_fixture(request):
FixedOffset(0), FixedOffset(-300), timezone.utc,
timezone(timedelta(hours=1)),
timezone(timedelta(hours=-1), name='foo')]
TIMEZONE_IDS = ['None', 'UTC', 'US/Eastern', 'Asia/Tokyp',
'dateutil/US/Pacific', 'dateutil/Asia/Singapore',
'dateutil.tz.tzutz()', 'dateutil.tz.tzlocal()',
'pytz.FixedOffset(300)', 'pytz.FixedOffset(0)',
'pytz.FixedOffset(-300)', 'datetime.timezone.utc',
'datetime.timezone.+1', 'datetime.timezone.-1.named']


@td.parametrize_fixture_doc(str(TIMEZONES))
@pytest.fixture(params=TIMEZONES)
@td.parametrize_fixture_doc(str(TIMEZONE_IDS))
@pytest.fixture(params=TIMEZONES, ids=TIMEZONE_IDS)
def tz_naive_fixture(request):
"""
Fixture for trying timezones including default (None): {0}
"""
return request.param


@td.parametrize_fixture_doc(str(TIMEZONES[1:]))
@pytest.fixture(params=TIMEZONES[1:])
@td.parametrize_fixture_doc(str(TIMEZONE_IDS[1:]))
@pytest.fixture(params=TIMEZONES[1:], ids=TIMEZONE_IDS[1:])
def tz_aware_fixture(request):
"""
Fixture for trying explicit timezones: {0}
Expand All @@ -409,16 +415,16 @@ def tz_aware_fixture(request):
COMPLEX_DTYPES = [complex, "complex64", "complex128"]
STRING_DTYPES = [str, 'str', 'U']

DATETIME_DTYPES = ['datetime64[ns]', 'M8[ns]']
TIMEDELTA_DTYPES = ['timedelta64[ns]', 'm8[ns]']
DATETIME64_DTYPES = ['datetime64[ns]', 'M8[ns]']
TIMEDELTA64_DTYPES = ['timedelta64[ns]', 'm8[ns]']

BOOL_DTYPES = [bool, 'bool']
BYTES_DTYPES = [bytes, 'bytes']
OBJECT_DTYPES = [object, 'object']

ALL_REAL_DTYPES = FLOAT_DTYPES + ALL_INT_DTYPES
ALL_NUMPY_DTYPES = (ALL_REAL_DTYPES + COMPLEX_DTYPES + STRING_DTYPES +
DATETIME_DTYPES + TIMEDELTA_DTYPES + BOOL_DTYPES +
DATETIME64_DTYPES + TIMEDELTA64_DTYPES + BOOL_DTYPES +
OBJECT_DTYPES + BYTES_DTYPES)


Expand Down

0 comments on commit f3f8d4f

Please sign in to comment.