-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Parameterize some compression tests #20337
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
Conversation
path, compression='bz3') | ||
if compress_type == 'bz2': | ||
pytest.raises(ValueError, self.read_csv, | ||
path, compression='bz3') |
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.
typo
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.
But the reason it's 'bz3' and not 'bz2' is that it's supposed to raise a ValueError
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.
ahh ok
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.
hmm i would put that testing of the error condition in a separate test
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.
actually on 2nd thought, this is ok.
ping on green. |
@@ -12,6 +12,10 @@ | |||
import pandas.util.testing as tm | |||
import pandas.util._test_decorators as td | |||
|
|||
import gzip | |||
import bz2 | |||
lzma = compat.import_lzma() |
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 is slightly annoying you have to skip that test if can't import lzma but you need the file reference
Traceback:
pandas/tests/io/parser/test_parsers.py:23: in <module>
from .compression import CompressionTests
pandas/tests/io/parser/compression.py:17: in <module>
lzma = compat.import_lzma()
pandas/compat/__init__.py:346: in import_lzma
from backports import lzma
E ImportError: cannot import name lzma
you might be able to do a
try:
lzma = compat.import_lzma()
except ImportError:
lzma = None
then change the below to
getattr(lzma, 'LZMAFile', None)
any other ideas @WillAyd
effae7b
to
3a6fd0d
Compare
Codecov Report
@@ Coverage Diff @@
## master #20337 +/- ##
==========================================
- Coverage 91.77% 91.73% -0.05%
==========================================
Files 152 150 -2
Lines 49196 49151 -45
==========================================
- Hits 45151 45090 -61
- Misses 4045 4061 +16
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #20337 +/- ##
=======================================
Coverage 91.77% 91.77%
=======================================
Files 152 152
Lines 49196 49196
=======================================
Hits 45151 45151
Misses 4045 4045
Continue to review full report at Codecov.
|
@jreback your suggestion worked so I think this is ready. Thanks! |
thanks! |
closes #19226
Parameterizing some tests in
pandas/tests/io/parser/compression.py
. I left the zip test alone because it was quite different to the others and I couldn't see an easy way to incorporate it in the parameterizing.