Skip to content

Two tests didn't properly assert an exception was raised. Fixed. #21409

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 6 commits into from
Jun 12, 2018

Conversation

akaihola
Copy link
Contributor

  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@@ -191,6 +191,5 @@ Other
^^^^^

- :meth: `~pandas.io.formats.style.Styler.background_gradient` now takes a ``text_color_threshold`` parameter to automatically lighten the text color based on the luminance of the background color. This improves readability with dark background colors without the need to limit the background colormap range. (:issue:`21258`)
-
-
- fixed two test cases which asserted an exception message but failed to make sure that an exception was actually raised
Copy link
Contributor

Choose a reason for hiding this comment

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

not necessary for test changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, reverted.

@@ -34,10 +34,9 @@ def test_buffer_overflow(self):
cperr = 'Buffer overflow caught - possible malformed input file.'

for malf in (malfw, malfs, malfl):
try:
with pytest.raises(pd.errors.ParserError) as excinfo:
Copy link
Contributor

Choose a reason for hiding this comment

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

can u parametrize this test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Parametrized in f47437e.

@codecov
Copy link

codecov bot commented Jun 10, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #21409      +/-   ##
==========================================
- Coverage   91.89%   91.89%   -0.01%     
==========================================
  Files         153      153              
  Lines       49600    49596       -4     
==========================================
- Hits        45580    45576       -4     
  Misses       4020     4020
Flag Coverage Δ
#multiple 90.29% <ø> (-0.01%) ⬇️
#single 41.86% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/base.py 96.61% <0%> (-0.01%) ⬇️
pandas/core/frame.py 97.22% <0%> (-0.01%) ⬇️
pandas/core/reshape/pivot.py 97.03% <0%> (ø) ⬆️
pandas/core/indexing.py 93.55% <0%> (ø) ⬆️

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 ffffa5c...ef25e39. Read the comment docs.

Antti Kaihola added 2 commits June 10, 2018 17:47
@gfyoung gfyoung added the Testing pandas testing functions or related to the test suite label Jun 10, 2018
Copy link
Member

@gfyoung gfyoung left a comment

Choose a reason for hiding this comment

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

Nice catch!

cc @jreback

@jreback jreback added this to the 0.23.2 milestone Jun 12, 2018
@jreback jreback added the IO CSV read_csv, to_csv label Jun 12, 2018
@jreback jreback modified the milestones: 0.23.2, 0.24.0 Jun 12, 2018
@jreback jreback merged commit 92e9882 into pandas-dev:master Jun 12, 2018
@jreback
Copy link
Contributor

jreback commented Jun 12, 2018

thanks @akaihola; slight change to use pytest ids, otherwise nice catch! keep em coming!

@akaihola akaihola deleted the exception-assertions branch June 17, 2018 12:58
david-liu-brattle-1 pushed a commit to david-liu-brattle-1/pandas that referenced this pull request Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO CSV read_csv, to_csv 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