-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN/TST: Convert tests/tseries/offset
to pytest idioms
#49095
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a couple of comments
@@ -29,3 +32,11 @@ def month_classes(request): | |||
Fixture for month based datetime offsets available for a time series. | |||
""" | |||
return request.param | |||
|
|||
|
|||
@pytest.fixture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about date or dt for the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure changed to dt
def test_immutable(self, offset_types): | ||
# GH#21341 check that __setattr__ raises | ||
offset = self._get_offset(offset_types) | ||
offset = _create_offset(offset_types) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you make a new fixture that does this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function is also used in the testing class helper methods so I think this is better (for now) as a separate function
Addressed and green |
thanks @mroeschke |
setup_method
topytest.fixture
s where neededBase
class (tests were moved in CLN: tseries/offsets base tests #49017) and refactored to a stand alone function