Skip to content

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

Merged
merged 5 commits into from
Oct 21, 2022

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke added Testing pandas testing functions or related to the test suite Frequency DateOffsets Clean labels Oct 14, 2022
@mroeschke mroeschke added this to the 2.0 milestone Oct 14, 2022
Copy link
Contributor

@jreback jreback left a 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
Copy link
Contributor

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?

Copy link
Member Author

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)
Copy link
Contributor

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

Copy link
Member Author

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

@mroeschke
Copy link
Member Author

Addressed and green

@jreback jreback merged commit 3774c8a into pandas-dev:main Oct 21, 2022
@jreback
Copy link
Contributor

jreback commented Oct 21, 2022

thanks @mroeschke

@mroeschke mroeschke deleted the cln/tst/offset_base branch October 21, 2022 22:02
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Frequency DateOffsets Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants