Skip to content

TST: Clean up pickle compression tests #19350

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
Jan 24, 2018

Conversation

reidy-p
Copy link
Contributor

@reidy-p reidy-p commented Jan 22, 2018

xref #19226

Move compression fixture to top-level conftest.py

Clean-up compression tests in pandas/tests/io/test_pickle.py and add zip to the decompress_file testing utility

Make some minor adjustments to the json and csv compression tests to skip zip compression when it's not valid

@@ -925,22 +925,23 @@ def test_to_csv_compression(self, compression):
[12.32112, 123123.2, 321321.2]],
index=['A', 'B'], columns=['X', 'Y', 'Z'])

with ensure_clean() as filename:
if compression != "zip":
Copy link
Contributor

Choose a reason for hiding this comment

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

you could do

if compression == 'zip':
    pytest.skip("not zip compression test for to_csv")

....

df.to_json(path, compression=compression)
assert_frame_equal(df, pd.read_json(path, compression=compression))
if compression != 'zip':
with tm.ensure_clean() as path:
Copy link
Contributor

Choose a reason for hiding this comment

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

same here (alternatively, you can make another fixed w/o zip), maybe compression_no_zip is better

@jreback jreback added the Testing pandas testing functions or related to the test suite label Jan 23, 2018
@reidy-p reidy-p force-pushed the pickle_compress_test_clean branch from 15e45a3 to 16328e0 Compare January 23, 2018 21:30
@jreback jreback added this to the 0.23.0 milestone Jan 24, 2018
@jreback
Copy link
Contributor

jreback commented Jan 24, 2018

lgtm. ping on green (or at least all linux builds on travis), seems mac may have some issues.

@codecov
Copy link

codecov bot commented Jan 24, 2018

Codecov Report

Merging #19350 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #19350      +/-   ##
==========================================
- Coverage   91.57%   91.56%   -0.01%     
==========================================
  Files         150      150              
  Lines       48705    48704       -1     
==========================================
- Hits        44600    44598       -2     
- Misses       4105     4106       +1
Flag Coverage Δ
#multiple 89.93% <0%> (-0.01%) ⬇️
#single 41.71% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/util/testing.py 83.83% <0%> (-0.62%) ⬇️
pandas/core/indexing.py 93.11% <0%> (+0.49%) ⬆️

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 5fdb9c0...16328e0. Read the comment docs.

@reidy-p
Copy link
Contributor Author

reidy-p commented Jan 24, 2018

@jreback it's green now, thanks!

@gfyoung gfyoung merged commit eb9e823 into pandas-dev:master Jan 24, 2018
@gfyoung
Copy link
Member

gfyoung commented Jan 24, 2018

Thanks @reidy-p !

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