-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Remove SharedItems from test_excel #26579
Conversation
def test_mixed(self, merge_cells, engine, ext): | ||
self.mixed_frame.to_excel(self.path, 'test1') | ||
def test_mixed(self, merge_cells, engine, ext, frame): | ||
mixed_frame = frame.copy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was previously a global variable. I didn't convert to a fixture like the rest simply because this is the only test that uses it
frame.to_excel(self.path, 'test1', | ||
index_label=['test'], | ||
merge_cells=merge_cells) | ||
df = (DataFrame(np.random.randn(10, 2)) >= 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So as not to confuse the fixture with a local variable I changed frame
to df
here (and in test_*_types tests)
@simonjayhawkins thanks for the thorough review - definitely making this PR a lot better. Latest push I think should address your callouts |
def test_ts_frame(self, *_): | ||
df = tm.makeTimeDataFrame()[:5] | ||
def test_ts_frame(self, tsframe, *_): | ||
df = tsframe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than duplicating logic leveraged the fixture here
Codecov Report
@@ Coverage Diff @@
## master #26579 +/- ##
===========================================
- Coverage 91.87% 41.8% -50.08%
===========================================
Files 174 174
Lines 50692 50692
===========================================
- Hits 46575 21190 -25385
- Misses 4117 29502 +25385
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26579 +/- ##
==========================================
- Coverage 91.87% 91.86% -0.02%
==========================================
Files 174 174
Lines 50692 50692
==========================================
- Hits 46575 46569 -6
- Misses 4117 4123 +6
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. @jreback
_mixed_frame['foo'] = 'bar' | ||
|
||
@pytest.fixture | ||
def frame(float_frame): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, next time around can you add some doc-strings, and/or make more meaningful names
thanks @WillAyd |
Pretty big step towards logically partitioning tests in this module - replaced SharedItems and instance attributes with fixtures. Should make subsequent test reorg easier
@simonjayhawkins