Skip to content

TST: refactored Excel reader tests #10964

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

Closed
wants to merge 8 commits into from

Conversation

davidovitch
Copy link
Contributor

This PR implements more flexible Excel (spreadsheet) reader tests. The work was originally part of the larger but unsuccessful PR #9070.

This PR includes:

  • Excel reader base class tests to facilitate adding the similar tests for other readers
  • not all Excel file formats (xls, xlsm, xlsx) had a corresponding test file. This PR adds the missing ones. Consequently, all Excel data files are now tested against all 3 Excel file formats.
  • rename test to test1 (for xls, xlsm, xlsx extensions) for consistency with test2..4 test data files. This also means that before merging (but after Travis has ran the tests) the URL of Excel test file test1.* has to be changed from davidovitch/pandas to pydata/pandas in pandas/io/tests/test_excel.py at line 378.

@jreback
Copy link
Contributor

jreback commented Sep 2, 2015

can you report the number of tests on current master (for the excel stuff) and number on this branch. Trying to figure out if anything is left out.

@jreback jreback added Testing pandas testing functions or related to the test suite IO Excel read_excel, to_excel labels Sep 2, 2015
@davidovitch
Copy link
Contributor Author

With this PR I have the following:

# pandas/io/tests/test_excel.py
Ran 283 tests in 9.364s
OK (SKIP=10)

and with 9bdae60 (same as above minus the 2 commits of this PR) I get:

# pandas/io/tests/test_excel.py
Ran 242 tests in 6.969s
OK (SKIP=10)

I have 10 skipped tests with openpyxl=1.8.6 being indicated as incompatible (the same for both this PR and 9bdae60). With openpyxl=2.2.4 I get failures that I haven't look into yet, but I also get these failures with 9bdae60. These failures are most likely due to my system since Travis is not complaining about them, but I will have to investigate this further to figure out what exactly is going on.

@jreback
Copy link
Contributor

jreback commented Sep 3, 2015

@chris-b1 can you have a look here

@jreback jreback added this to the 0.17.0 milestone Sep 3, 2015
"""
Return a DataFrame as read by the Python csv engine and a DataFrame
as read by the ExcelFile engine. Test data path is defined by
pandas.util.testing.get_data_path()
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this be more clear it returns 1 or 2 items? Part of me thinks it should just be two functions.

@chris-b1
Copy link
Contributor

chris-b1 commented Sep 3, 2015

Added a couple comments, overall approach seems pretty reasonable.

@davidovitch
Copy link
Contributor Author

@chris-b1 does this sufficiently address your comments?

@jreback
Copy link
Contributor

jreback commented Sep 5, 2015

@davidovitch pls squash.

@jreback
Copy link
Contributor

jreback commented Sep 5, 2015

ok, going to merge this, @chris-b1 you will prob need to rebase your excel pr

@jreback
Copy link
Contributor

jreback commented Sep 5, 2015

merged via 98b3a5d

thanks!

@davidovitch
Copy link
Contributor Author

@jreback: Sorry, was too late for squashing and correcting one small thing: the URL of the renamed test file was still pointing my repo instead of pydata/pandas. See PR #11009.

@chris-b1
Copy link
Contributor

chris-b1 commented Sep 5, 2015

I fixed this in my other PR when I rebased.
On Sep 5, 2015 3:14 PM, "David Verelst" [email protected] wrote:

@jreback https://github.com/jreback: Sorry, was too late for squashing
and correcting one small thing: the URL of the renamed test file was still
pointing my repo instead of pydata/pandas. See PR #11009
#11009.


Reply to this email directly or view it on GitHub
#10964 (comment).

@davidovitch
Copy link
Contributor Author

ah ok, great! No need for PR #11009, closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Excel read_excel, to_excel 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