Skip to content

REF/TST: Add more pytest idiom to tests/resample #24230

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 12 commits into from
Dec 13, 2018

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins commented Dec 11, 2018

xref #17806
follow-on from #24013

This pass replaces imports from tests/resample/test_base.py with fixtures and only parametrizes tests where necessary to accomplish this.

@pep8speaks
Copy link

Hello @simonjayhawkins! Thanks for submitting the PR.

raise
expected.index = inds
assert_series_equal(result, expected)
except BaseException as exc:
Copy link
Contributor

Choose a reason for hiding this comment

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

can you remove this catching of BaseException (e.g. the try/accept), with parameterized methods it is uncessary

@@ -140,7 +138,7 @@ def test_resample_how(self):
grouplist[1:6] = 1
grouplist[6:11] = 2
grouplist[11:] = 3
args = downsample_methods
arg = downsample_method
Copy link
Contributor

Choose a reason for hiding this comment

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

it might be worthile to move ohlc to a separate test

@@ -15,8 +15,7 @@
from pandas import DataFrame, Series, Timestamp
from pandas.core.indexes.datetimes import date_range
from pandas.core.indexes.period import Period, PeriodIndex, period_range
from pandas.tests.resample.test_base import (
Base, resample_methods, simple_period_range_series)
from pandas.tests.resample.test_base import Base
Copy link
Contributor

Choose a reason for hiding this comment

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

is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

all the tests in Base are run for each class that inherits from Base. so the next pass will be to parametrize the Base class over the parameters in the classes that inherit from Base in order to be able to remove this dependency. I'll do this in a separate pass since the tests in Base rely on a method override so it is not trivial.

@jreback jreback added Testing pandas testing functions or related to the test suite Resample resample method labels Dec 11, 2018
@codecov
Copy link

codecov bot commented Dec 11, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24230   +/-   ##
=======================================
  Coverage   92.21%   92.21%           
=======================================
  Files         162      162           
  Lines       51763    51763           
=======================================
  Hits        47733    47733           
  Misses       4030     4030
Flag Coverage Δ
#multiple 90.61% <ø> (ø) ⬆️
#single 43% <ø> (ø) ⬆️

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 c994e98...1484708. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 11, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24230   +/-   ##
=======================================
  Coverage   92.22%   92.22%           
=======================================
  Files         162      162           
  Lines       51785    51785           
=======================================
  Hits        47759    47759           
  Misses       4026     4026
Flag Coverage Δ
#multiple 90.62% <ø> (ø) ⬆️
#single 43.01% <ø> (ø) ⬆️

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 2f6d682...693f84a. Read the comment docs.

@jreback jreback added this to the 0.24.0 milestone Dec 13, 2018
@jreback
Copy link
Contributor

jreback commented Dec 13, 2018

lgtm. can you merge master and ping on green as just merged a resample bug fix.

@simonjayhawkins
Copy link
Member Author

@jreback green!

@jreback jreback merged commit c037128 into pandas-dev:master Dec 13, 2018
@jreback
Copy link
Contributor

jreback commented Dec 13, 2018

thanks @simonjayhawkins

@simonjayhawkins simonjayhawkins deleted the resample-fixtures branch December 13, 2018 19:37
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resample resample method 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