-
-
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
Conversation
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 PR. Just a comment on test location but lgtm otherwise
pandas/tests/plotting/test_frame.py
Outdated
@@ -3350,6 +3352,21 @@ def test_colors_of_columns_with_same_name(self): | |||
for legend, line in zip(result.get_legend().legendHandles, result.lines): | |||
assert legend.get_color() == line.get_color() | |||
|
|||
def test__check_ticks_props(self): |
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.
Can you put this test in a separate module? test_common.py
should be fine
pandas/tests/plotting/test_frame.py
Outdated
@@ -48,6 +48,7 @@ def _assert_xtickslabels_visibility(self, axes, expected): | |||
for ax, exp in zip(axes, expected): | |||
self._check_visible(ax.get_xticklabels(), visible=exp) | |||
|
|||
@pytest.mark.xfail(reason="Waiting for PR 34334") |
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
self._check_ticks_props(ax, xrot=0)
. On master, self._check_ticks_props(ax, xrot=0)
always passes (regardless of what xrot
actually is in the plot). And so even though xrot
is 30
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).
@TomAugspurger care to look? |
Thanks. |
Here's something I noticed while working on #34334 :
self._check_ticks_props(ax, ylabelsize=0)
always passes!This is because of
instead of
being used.
The test I've added fails on master: