Skip to content
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

Split test_excel into submodule #26755

Merged
merged 3 commits into from
Jun 9, 2019
Merged

Conversation

WillAyd
Copy link
Member

@WillAyd WillAyd commented Jun 9, 2019

@simonjayhawkins

Just moved everything as is. Some of the class structures are unnecessary now but leaving for follow ups

@WillAyd WillAyd added Testing pandas testing functions or related to the test suite IO Excel read_excel, to_excel labels Jun 9, 2019
pandas/tests/io/excel/conftest.py Show resolved Hide resolved


@pytest.fixture
def df_ref():
Copy link
Member Author

Choose a reason for hiding this comment

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

Similar comment as above but this would only be used in the reader tests



@pytest.fixture(params=[True, False])
def merge_cells(request):
Copy link
Member Author

Choose a reason for hiding this comment

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

Also only used in writers

@codecov
Copy link

codecov bot commented Jun 9, 2019

Codecov Report

Merging #26755 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26755      +/-   ##
==========================================
- Coverage    91.7%   91.69%   -0.01%     
==========================================
  Files         179      179              
  Lines       50767    50767              
==========================================
- Hits        46555    46552       -3     
- Misses       4212     4215       +3
Flag Coverage Δ
#multiple 90.29% <ø> (ø) ⬆️
#single 41.22% <ø> (-0.07%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 96.88% <0%> (-0.12%) ⬇️
pandas/util/testing.py 90.73% <0%> (+0.1%) ⬆️

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 c7748ca...0f9ceaf. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 9, 2019

Codecov Report

Merging #26755 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #26755      +/-   ##
==========================================
- Coverage    91.7%   91.69%   -0.01%     
==========================================
  Files         179      178       -1     
  Lines       50767    50758       -9     
==========================================
- Hits        46555    46543      -12     
- Misses       4212     4215       +3
Flag Coverage Δ
#multiple 90.29% <ø> (-0.01%) ⬇️
#single 41.21% <ø> (-0.08%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 78.94% <0%> (-10.53%) ⬇️
pandas/core/frame.py 96.88% <0%> (-0.12%) ⬇️
pandas/io/excel/__init__.py
pandas/util/testing.py 90.73% <0%> (+0.1%) ⬆️

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 c7748ca...d2a5d3a. Read the comment docs.

Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

@WillAyd lgtm.

does this now close #24472?

it doesn't seem to affect test discoverabily but should there be an __init__.py? I think all the other test directories have them.

is there going to be a further split of test_writers.py and test_readers.py?

pandas/tests/io/excel/conftest.py Show resolved Hide resolved
@WillAyd
Copy link
Member Author

WillAyd commented Jun 9, 2019

Yea I think the init is a good idea to preserve the namespacing so just pushed. Also updated OP to reflect closure of issue

Copy link
Member

@simonjayhawkins simonjayhawkins left a comment

Choose a reason for hiding this comment

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

Thanks @WillAyd . Nice!

@simonjayhawkins simonjayhawkins added this to the 0.25.0 milestone Jun 9, 2019
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

so

  • you can use pytest.importorskip here and directly import things
  • If you can not use the class structure I would do it. Since this changes lots of code I would do it in this PR.

from pandas.io.excel import ExcelWriter, _OpenpyxlWriter


@td.skip_if_no('openpyxl')
Copy link
Contributor

Choose a reason for hiding this comment

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

use a pytest.importorskip

also I would not use classes unless you have separate discrete cases


tm.assert_frame_equal(expected, actual)

@td.skip_if_no('py.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 remove this test entirely


class TestReaders:

@pytest.fixture(autouse=True, params=[
Copy link
Contributor

Choose a reason for hiding this comment

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

can these just be module pytest.importorskip?

register_writer)


@td.skip_if_no('xlrd')
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above

from pandas.io.excel import ExcelFile


@td.skip_if_no('xlrd')
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment

@simonjayhawkins
Copy link
Member

@jreback IIUC this is just a plain split and move, no changes. your comments will be addressed in follow-ups.

@jreback
Copy link
Contributor

jreback commented Jun 9, 2019

ok that's fine

@jreback jreback merged commit 9413591 into pandas-dev:master Jun 9, 2019
@simonjayhawkins
Copy link
Member

@WillAyd I know it was a lot of work to be able to get to this point. If you now want to focus and push on with #25092 and #25427, then i'll be happy to carry-on with the clean-up and address @jreback comments.

@WillAyd WillAyd deleted the xl-test-submod branch June 10, 2019 02:27
@WillAyd
Copy link
Member Author

WillAyd commented Jun 10, 2019

@simonjayhawkins that would be great - thanks for offering!

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.

TST: Split test_excel into sub test files
3 participants