Skip to content
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: xfail some tests for mpl 2.2 compat #20033

Merged
merged 1 commit into from
Mar 7, 2018
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
4 changes: 2 additions & 2 deletions pandas/tests/plotting/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,10 +1356,10 @@ def test_plot_outofbounds_datetime(self):
values = [datetime(1677, 1, 1, 12), datetime(1677, 1, 2, 12)]
ax.plot(values)

@td.xfail_if_mpl_2_2
@pytest.mark.skip(
is_platform_mac(),
"skip on mac for precision display issue on older mpl")
@pytest.mark.xfail(reason="suspect on mpl 2.2.2")
def test_format_timedelta_ticks_narrow(self):

if self.mpl_ge_2_0_0:
Expand All @@ -1381,10 +1381,10 @@ def test_format_timedelta_ticks_narrow(self):
for l, l_expected in zip(labels, expected_labels):
assert l.get_text() == l_expected

@td.xfail_if_mpl_2_2
@pytest.mark.skip(
is_platform_mac(),
"skip on mac for precision display issue on older mpl")
@pytest.mark.xfail(reason="suspect on mpl 2.2.2")
def test_format_timedelta_ticks_wide(self):

if self.mpl_ge_2_0_0:
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/plotting/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2461,6 +2461,7 @@ def test_errorbar_asymmetrical(self):

tm.close()

@td.xfail_if_mpl_2_2
def test_table(self):
df = DataFrame(np.random.rand(10, 3),
index=list(string.ascii_letters[:10]))
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/plotting/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def test_bootstrap_plot(self):
@td.skip_if_no_mpl
class TestDataFramePlots(TestPlotBase):

@td.xfail_if_mpl_2_2
@td.skip_if_no_scipy
def test_scatter_matrix_axis(self):
scatter_matrix = plotting.scatter_matrix
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/plotting/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ def test_errorbar_plot(self):
with pytest.raises((ValueError, TypeError)):
s.plot(yerr=s_err)

@td.xfail_if_mpl_2_2
def test_table(self):
_check_plot_works(self.series.plot, table=True)
_check_plot_works(self.series.plot, table=self.series)
Expand Down
13 changes: 13 additions & 0 deletions pandas/util/_test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ def _skip_if_mpl_1_5():
mod.use("Agg", warn=False)


def _skip_if_mpl_2_2():
mod = safe_import("matplotlib")

if mod:
v = mod.__version__
if LooseVersion(v) > LooseVersion('2.1.2'):
return True
else:
mod.use("Agg", warn=False)


def _skip_if_has_locale():
lang, _ = locale.getlocale()
if lang is not None:
Expand Down Expand Up @@ -151,6 +162,8 @@ def decorated_func(func):
reason="Missing matplotlib dependency")
skip_if_mpl_1_5 = pytest.mark.skipif(_skip_if_mpl_1_5(),
reason="matplotlib 1.5")
xfail_if_mpl_2_2 = pytest.mark.xfail(_skip_if_mpl_2_2(),
reason="matplotlib 2.2")
skip_if_32bit = pytest.mark.skipif(is_platform_32bit(),
reason="skipping for 32 bit")
skip_if_windows = pytest.mark.skipif(is_platform_windows(),
Expand Down