Skip to content

TST: Collect/Use arithmetic test fixtures #22645

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
Sep 12, 2018

Conversation

jbrockmendel
Copy link
Member

Takes over from #22350 (which would have been a rebasing nightmare), addressing AFAICT all unaddressed comments from there.

All remaining fixtures in tests/arithmetic are collected in tests/arithmetic/conftest.py
Fixtures are given more descriptive names and docstrings as requested in #22350.

A handful of tests are altered to use fixtures; in a number of cases their pytest.mark.parametrize arguments were already equivalent to one of the fixtures.

A few new broken cases are identified, specifically numeric Series and DataFrame __mul__ or __rdiv__ with a) non-nanosecond timedelta64 or b) Tick. (I'll open an Issue for these)

Some tests got cleaned up nicely by using tm.assert_equal instead of parametrizing with assert_func

@pep8speaks
Copy link

pep8speaks commented Sep 9, 2018

Hello @jbrockmendel! Thanks for updating the PR.

Line 154:19: W504 line break after binary operator

Comment last updated on September 10, 2018 at 01:57 Hours UTC

@jbrockmendel
Copy link
Member Author

In the file pandas/tests/arithmetic/test_numeric.py, following are the PEP8 issues :

Line 154:19: W504 line break after binary operator

setup.cfg has W503 ignored for this this warning. Why does pep8speaks think its W504?

@jbrockmendel jbrockmendel changed the title Collect/Use arithmetic test fixtures TST: Collect/Use arithmetic test fixtures Sep 9, 2018
@jbrockmendel
Copy link
Member Author

Traditional resourceWarning in circleCI

@codecov
Copy link

codecov bot commented Sep 10, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22645   +/-   ##
=======================================
  Coverage   92.17%   92.17%           
=======================================
  Files         169      169           
  Lines       50708    50708           
=======================================
  Hits        46740    46740           
  Misses       3968     3968
Flag Coverage Δ
#multiple 90.58% <ø> (ø) ⬆️
#single 42.35% <ø> (ø) ⬆️

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 0976e12...d935afc. Read the comment docs.

@jreback jreback added the Testing pandas testing functions or related to the test suite label Sep 12, 2018
@jreback jreback added this to the 0.24.0 milestone Sep 12, 2018
return request.param


@pytest.fixture
def tdser():
Copy link
Contributor

Choose a reason for hiding this comment

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

should conform / rename these at some point (e.g. have been using: timedelta_series) for something like this

ids=lambda x: type(x).__name__)
def idx(request):
def numeric_idx(request):
Copy link
Contributor

Choose a reason for hiding this comment

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

numeric_index (can be future PR)

Return a Series with dtype='timedelta64[ns]', including a NaT.
"""
return pd.Series(['59 Days', '59 Days', 'NaT'], dtype='timedelta64[ns]')

Copy link
Contributor

Choose a reason for hiding this comment

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

these 2 fixtures should be pushed up to pandas/conftest.py as well

@jreback jreback merged commit 7ce722c into pandas-dev:master Sep 12, 2018
@jreback
Copy link
Contributor

jreback commented Sep 12, 2018

thanks. my comments are for a future PR FYI

@jbrockmendel jbrockmendel deleted the arith_tests10 branch September 12, 2018 13:41
aeltanawy pushed a commit to aeltanawy/pandas that referenced this pull request Sep 20, 2018
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
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