-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
TST Replace unittest.TestCase.fail calls, use pytest.raises instead of legacy constructs #22681
Conversation
Hello @rth! Thanks for submitting the PR.
|
pandas/tests/plotting/test_frame.py
Outdated
@@ -588,17 +588,13 @@ def test_subplots_layout(self): | |||
@pytest.mark.slow | |||
def test_subplots_warnings(self): | |||
# GH 9464 | |||
warnings.simplefilter('error') | |||
try: | |||
with pytest.warns(Warning): |
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.
Asserting that a warning is raised is too general. Currently this passes, but no warning related to matplotlib are raised (at least locally for me), instead I get,
The list of emitted warnings is:
[DeprecationWarning("Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working"),
DeprecationWarning("Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working")].
Just FYI, it's an unrelated issue.
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.
use tm.assert_produces_warning
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.
Thanks for the review!
Sorry, I misread the code, it meant to check that no warnings are raised, please ignore my comment above. Fixed it now.
32b7b0f
to
56a0394
Compare
Codecov Report
@@ Coverage Diff @@
## master #22681 +/- ##
=======================================
Coverage 92.17% 92.17%
=======================================
Files 169 169
Lines 50715 50715
=======================================
Hits 46747 46747
Misses 3968 3968
Continue to review full report at Codecov.
|
8135ebc
to
89c2a1e
Compare
can you rebase on master, ping on green. |
89c2a1e
to
d0f2bed
Compare
@jreback I rebased -- Travis CI passed but there is still one failure in |
thanks @rth |
Similarly to numpy/numpy#11933,
In addition this uses
pytest.raises
instead of more complicated legacy constructions of the form,A few additional minor issues are discussed in comments below.