Skip to content

REF/TST: Add more pytest idiom to indexing/multiindex/test_iloc.py #24272

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 2 commits into from
Dec 14, 2018

Conversation

simonjayhawkins
Copy link
Member

@simonjayhawkins simonjayhawkins commented Dec 13, 2018

in this PR:

  • unskip test_iloc_getitem_multiindex2. difference in series name resolved. some tests were duplicated in test_iloc_getitem_multiindex
  • .ix removed. this was only used to generate expected values. this module is to test .loc functionality only. integer indexing on the numpy array used to create dataframe used instead.
  • class removed
  • some renaming of variables
  • and splitting and paramatrizing.

@pep8speaks
Copy link

Hello @simonjayhawkins! Thanks for submitting the PR.

@codecov
Copy link

codecov bot commented Dec 13, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24272   +/-   ##
=======================================
  Coverage   92.22%   92.22%           
=======================================
  Files         162      162           
  Lines       51785    51785           
=======================================
  Hits        47758    47758           
  Misses       4027     4027
Flag Coverage Δ
#multiple 90.62% <ø> (ø) ⬆️
#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 c037128...4ab1a53. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 13, 2018

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24272   +/-   ##
=======================================
  Coverage   92.22%   92.22%           
=======================================
  Files         162      162           
  Lines       51785    51785           
=======================================
  Hits        47758    47758           
  Misses       4027     4027
Flag Coverage Δ
#multiple 90.62% <ø> (ø) ⬆️
#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 c037128...55d6c18. Read the comment docs.

@jreback jreback added Testing pandas testing functions or related to the test suite Indexing Related to indexing on series/frames, not to indexes themselves labels Dec 13, 2018
@jreback jreback added this to the 0.24.0 milestone Dec 13, 2018

try:
tm.assert_equal(result, expected)
except NotImplementedError:
Copy link
Contributor

Choose a reason for hiding this comment

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

what case hits this? would like to more explict here (e.g. not using a try/except)

Copy link
Member Author

Choose a reason for hiding this comment

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

@jreback .loc returns either a series, dataframe or scalar value, the except is for the scalar values. it may be better to split this test into three seperate tests; test_iloc_returns_series, test_iloc_returns_dataframe, and test_iloc_returns_scalar. we would then be duplicating the setup but this could be made a fixture. what's you thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes let's do that. i am very leary anytime have a try/except in a test as they often hide actual errors.

@jreback jreback merged commit 52d9714 into pandas-dev:master Dec 14, 2018
@jreback
Copy link
Contributor

jreback commented Dec 14, 2018

thanks!

@simonjayhawkins simonjayhawkins deleted the skipped-test branch December 15, 2018 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves 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