Skip to content

CLN: Parameterize test case #22327

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
Aug 14, 2018
Merged

CLN: Parameterize test case #22327

merged 5 commits into from
Aug 14, 2018

Conversation

alimcmaster1
Copy link
Member

  • [y] passes git diff upstream/master -u -- "*.py" | flake8 --diff

])
def test_round_day_naive(self, timestamp_input, round_freq, date):
dt = Timestamp(timestamp_input)
result = dt.round(round_freq)
Copy link
Member

Choose a reason for hiding this comment

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

By nature of this test I suppose we don't really need round_freq as a parameter and can instead just hard code it here (unless you are being forward-looking and trying to integrate other frequencies)

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks for taking a look @WillAyd , turns out there was another similar test function in the same file so I combined them. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Nice! Just one more minor nit looks like your test is called test_test_round_frequencies - can just change to test_round_frequencies

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh my bad.. thanks have done!

@WillAyd WillAyd added Testing pandas testing functions or related to the test suite Datetime Datetime data dtype labels Aug 13, 2018
@codecov
Copy link

codecov bot commented Aug 13, 2018

Codecov Report

Merging #22327 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22327   +/-   ##
=======================================
  Coverage   92.08%   92.08%           
=======================================
  Files         169      169           
  Lines       50706    50706           
=======================================
  Hits        46691    46691           
  Misses       4015     4015
Flag Coverage Δ
#multiple 90.49% <ø> (ø) ⬆️
#single 42.33% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 601d71f...b78995c. Read the comment docs.

@jreback jreback added this to the 0.24.0 milestone Aug 13, 2018
dt = Timestamp('20130104 12:00:00')
result = dt.round('D')
expected = Timestamp('20130105')
@pytest.mark.parametrize('timestamp_input, round_freq, date', [
Copy link
Contributor

Choose a reason for hiding this comment

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

just call this timestamp, freq, expected for the args, otherwise lgtm.

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks @jreback updated

@jreback
Copy link
Contributor

jreback commented Aug 14, 2018

lgtm. ping on green.

@jreback jreback merged commit 99dc764 into pandas-dev:master Aug 14, 2018
@jreback
Copy link
Contributor

jreback commented Aug 14, 2018

thanks @alimcmaster1

Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants