-
-
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
BUG, TST: fix-_check_ticks_props #34768
Merged
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d7657bf
fix-_check_ticks_props
MarcoGorelli 642da78
pr number
MarcoGorelli 24200db
catch message
MarcoGorelli f711ff4
xfail tests which shouldn't be passing
MarcoGorelli 579fc38
Update pandas/tests/plotting/test_frame.py
MarcoGorelli 02c9d49
move test
MarcoGorelli 0497a26
strict xfail
MarcoGorelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import pytest | ||
|
||
import pandas.util._test_decorators as td | ||
|
||
from pandas import DataFrame | ||
from pandas.tests.plotting.common import TestPlotBase, _check_plot_works | ||
|
||
|
||
@td.skip_if_no_mpl | ||
class TestCommon(TestPlotBase): | ||
def test__check_ticks_props(self): | ||
# GH 34768 | ||
df = DataFrame({"b": [0, 1, 0], "a": [1, 2, 3]}) | ||
ax = _check_plot_works(df.plot, rot=30) | ||
ax.yaxis.set_tick_params(rotation=30) | ||
msg = "expected 0.00000 but got " | ||
with pytest.raises(AssertionError, match=msg): | ||
self._check_ticks_props(ax, xrot=0) | ||
with pytest.raises(AssertionError, match=msg): | ||
self._check_ticks_props(ax, xlabelsize=0) | ||
with pytest.raises(AssertionError, match=msg): | ||
self._check_ticks_props(ax, yrot=0) | ||
with pytest.raises(AssertionError, match=msg): | ||
self._check_ticks_props(ax, ylabelsize=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just for my understanding this is still running on CI right? Not immediately clear why these need to be xfailed now but I assume this pre-cursor to the mentioned PR highlights an issue with how these tests are written?
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.
The problem with this test is the line
. On master,
self._check_ticks_props(ax, xrot=0)
always passes (regardless of whatxrot
actually is in the plot). And so even thoughxrot
is30
in this plot, the test still passes.However, if we change
self._check_ticks_props(ax, xrot=0)
so that it actually catches errors, then this test will fail, because the xticklabels are being unnecessarily rotated.PR #34334 would remove the unnecessary rotation, and then this test would go back to passing (as expected).