Skip to content

TST: Add more information for unexpected warnings #21779

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

Conversation

gfyoung
Copy link
Member

@gfyoung gfyoung commented Jul 6, 2018

Title is self-explanatory.

This will be useful for uncovering the problematic files (hopefully) if / when #21763 rears its head.

@gfyoung gfyoung added Testing pandas testing functions or related to the test suite Error Reporting Incorrect or improved errors from pandas labels Jul 6, 2018
@gfyoung gfyoung added this to the 0.24.0 milestone Jul 6, 2018
@jreback
Copy link
Contributor

jreback commented Jul 6, 2018

what does this look like when it shows the warnings?

@gfyoung
Copy link
Member Author

gfyoung commented Jul 6, 2018

import pandas.util.testing as tm
import warnings
with tm.assert_produces_warning(None):
    warnings.warn("Warning!")
...
Traceback (most recent call last):
...
AssertionError: Caused unexpected warning(s): [('UserWarning', 'Warning!', '__main__', 2)].

@codecov
Copy link

codecov bot commented Jul 7, 2018

Codecov Report

Merging #21779 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #21779   +/-   ##
=======================================
  Coverage   91.94%   91.94%           
=======================================
  Files         160      160           
  Lines       49819    49819           
=======================================
  Hits        45806    45806           
  Misses       4013     4013
Flag Coverage Δ
#multiple 90.32% <0%> (ø) ⬆️
#single 42.07% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/util/testing.py 85.33% <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 30eb48c...adb94c3. Read the comment docs.

@jreback jreback merged commit 9ad8aa7 into pandas-dev:master Jul 7, 2018
@gfyoung gfyoung deleted the more-info-unexpected-warning branch July 7, 2018 18:10
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants