Skip to content

TST: skip assert for mpl 3.1+ #26715

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 4 commits into from
Jun 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ci/deps/travis-36-cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ dependencies:
# https://github.com/pydata/pandas-gbq/issues/271
- google-cloud-bigquery<=1.11
- psycopg2
- pyarrow=0.9.0
# pyarrow segfaults on load: https://github.com/pandas-dev/pandas/issues/26716
# - pyarrow=0.9.0
- pymysql
- pytables
- python-snappy
Expand Down
17 changes: 13 additions & 4 deletions pandas/tests/plotting/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def setup_method(self, method):

self.mpl_ge_2_2_3 = plotting._compat._mpl_ge_2_2_3()
self.mpl_ge_3_0_0 = plotting._compat._mpl_ge_3_0_0()
self.mpl_ge_3_1_0 = plotting._compat._mpl_ge_3_1_0()

self.bp_n_objects = 7
self.polycollection_factor = 2
Expand Down Expand Up @@ -440,10 +441,18 @@ def _check_grid_settings(self, obj, kinds, kws={}):
import matplotlib as mpl

def is_grid_on():
xoff = all(not g.gridOn
for g in self.plt.gca().xaxis.get_major_ticks())
yoff = all(not g.gridOn
for g in self.plt.gca().yaxis.get_major_ticks())
xticks = self.plt.gca().xaxis.get_major_ticks()
yticks = self.plt.gca().yaxis.get_major_ticks()
# for mpl 2.2.2, gridOn and gridline.get_visible disagree.
# for new MPL, they are the same.

if self.mpl_ge_3_0_0:
xoff = all(not g.gridline.get_visible() for g in xticks)
yoff = all(not g.gridline.get_visible() for g in yticks)
else:
xoff = all(not g.gridOn for g in xticks)
yoff = all(not g.gridOn for g in yticks)

return not (xoff and yoff)

spndx = 1
Expand Down
6 changes: 4 additions & 2 deletions pandas/tests/plotting/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,10 @@ def test_subplots(self):
for ax in axes[:-2]:
self._check_visible(ax.xaxis) # xaxis must be visible for grid
self._check_visible(ax.get_xticklabels(), visible=False)
self._check_visible(
ax.get_xticklabels(minor=True), visible=False)
if not (kind == 'bar' and self.mpl_ge_3_1_0):
# change https://github.com/pandas-dev/pandas/issues/26714
self._check_visible(
ax.get_xticklabels(minor=True), visible=False)
self._check_visible(ax.xaxis.get_label(), visible=False)
self._check_visible(ax.get_yticklabels())

Expand Down