Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tseries fixtures docstrings #21496

Merged
merged 11 commits into from
Jul 8, 2018
1 change: 1 addition & 0 deletions pandas/tests/indexes/datetimes/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'US/Eastern', 'dateutil/Asia/Singapore',
'dateutil/US/Pacific'])
def tz(request):
# TODO: repeated fixture
return request.param


Expand Down
1 change: 1 addition & 0 deletions pandas/tests/indexes/datetimes/test_scalar_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'US/Eastern', 'dateutil/Asia/Singapore',
'dateutil/US/Pacific'])
def tz(request):
# TODO: repeated fixture
return request.param


Expand Down
3 changes: 3 additions & 0 deletions pandas/tests/tseries/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@
@pytest.fixture(params=[None, 'UTC', 'Asia/Tokyo', 'US/Eastern',
'dateutil/Asia/Tokyo', 'dateutil/US/Pacific'])
def tz(request):
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so happy to have you remove all of the tz fixtures (that are marked repeated), and use the top-level tz_naive_fixture (you can add 'dateutil/Asia/Tokyo') to that as well. I think that should be fine. you will need to change the references in each file (where the fixture is now) in order to make this work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also will I need to change the reference to the tz fixture to the tz_naive_fixture right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Fixture for different timezones strings.
"""
return request.param
13 changes: 13 additions & 0 deletions pandas/tests/tseries/offsets/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,36 @@

@pytest.fixture(params=[getattr(offsets, o) for o in offsets.__all__])
def offset_types(request):
"""
Fixture for all the datetime offsets available for a time series.
"""
return request.param


@pytest.fixture(params=[getattr(offsets, o) for o in offsets.__all__ if
issubclass(getattr(offsets, o), offsets.MonthOffset)
and o != 'MonthOffset'])
def month_classes(request):
"""
Fixture for month based datetime offsets available for a time series.
"""
return request.param


@pytest.fixture(params=[getattr(offsets, o) for o in offsets.__all__ if
issubclass(getattr(offsets, o), offsets.Tick)])
def tick_classes(request):
"""
Fixture for Tick based datetime offsets available for a time series.
"""
return request.param


@pytest.fixture(params=[None, 'UTC', 'Asia/Tokyo', 'US/Eastern',
'dateutil/Asia/Tokyo', 'dateutil/US/Pacific'])
def tz(request):
"""
Fixture for different timezones strings.
# TODO: repeated fixture
"""
return request.param