Skip to content

Commit

Permalink
skips
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Aug 21, 2017
1 parent 33c9e04 commit ada6834
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pandas/tests/frame/test_rank.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
import pytest
from datetime import timedelta, datetime
from distutils.version import LooseVersion
from numpy import nan
Expand Down Expand Up @@ -195,6 +196,7 @@ def test_rank_axis(self):
def test_rank_methods_frame(self):
tm.skip_if_no_package('scipy', min_version='0.13',
app='scipy.stats.rankdata')
pytest.importorskip('scipy.stats.special')
import scipy
from scipy.stats import rankdata

Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/plotting/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def _ok_for_gaussian_kde(kind):
from scipy.stats import gaussian_kde # noqa
except ImportError:
return False
return True

return plotting._compat._mpl_ge_1_5_0()


class TestPlotBase(object):
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/plotting/test_datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,8 @@ def test_secondary_y_ts(self):

@pytest.mark.slow
def test_secondary_kde(self):
if not self.mpl_ge_1_5_0:
pytest.skip("mpl is not supported")
tm._skip_if_no_scipy()
_skip_if_no_scipy_gaussian_kde()

Expand Down
10 changes: 10 additions & 0 deletions pandas/tests/plotting/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,9 @@ def test_boxplot_subplots_return_type(self):
def test_kde_df(self):
tm._skip_if_no_scipy()
_skip_if_no_scipy_gaussian_kde()
if not self.mpl_ge_1_5_0:
pytest.skip("mpl is not supported")

df = DataFrame(randn(100, 4))
ax = _check_plot_works(df.plot, kind='kde')
expected = [pprint_thing(c) for c in df.columns]
Expand All @@ -1310,6 +1313,9 @@ def test_kde_df(self):
def test_kde_missing_vals(self):
tm._skip_if_no_scipy()
_skip_if_no_scipy_gaussian_kde()
if not self.mpl_ge_1_5_0:
pytest.skip("mpl is not supported")

df = DataFrame(np.random.uniform(size=(100, 4)))
df.loc[0, 0] = np.nan
_check_plot_works(df.plot, kind='kde')
Expand Down Expand Up @@ -1834,6 +1840,8 @@ def test_hist_colors(self):
def test_kde_colors(self):
tm._skip_if_no_scipy()
_skip_if_no_scipy_gaussian_kde()
if not self.mpl_ge_1_5_0:
pytest.skip("mpl is not supported")

from matplotlib import cm

Expand All @@ -1857,6 +1865,8 @@ def test_kde_colors(self):
def test_kde_colors_and_styles_subplots(self):
tm._skip_if_no_scipy()
_skip_if_no_scipy_gaussian_kde()
if not self.mpl_ge_1_5_0:
pytest.skip("mpl is not supported")

from matplotlib import cm
default_colors = self._maybe_unpack_cycler(self.plt.rcParams)
Expand Down
12 changes: 12 additions & 0 deletions pandas/tests/plotting/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ def test_plot_fails_with_dupe_color_and_style(self):

@pytest.mark.slow
def test_hist_kde(self):
if not self.mpl_ge_1_5_0:
pytest.skip("mpl is not supported")

_, ax = self.plt.subplots()
ax = self.ts.plot.hist(logy=True, ax=ax)
self._check_ax_scales(ax, yaxis='log')
Expand All @@ -596,6 +599,9 @@ def test_hist_kde(self):
def test_kde_kwargs(self):
tm._skip_if_no_scipy()
_skip_if_no_scipy_gaussian_kde()
if not self.mpl_ge_1_5_0:
pytest.skip("mpl is not supported")

from numpy import linspace
_check_plot_works(self.ts.plot.kde, bw_method=.5,
ind=linspace(-100, 100, 20))
Expand All @@ -611,6 +617,9 @@ def test_kde_kwargs(self):
def test_kde_missing_vals(self):
tm._skip_if_no_scipy()
_skip_if_no_scipy_gaussian_kde()
if not self.mpl_ge_1_5_0:
pytest.skip("mpl is not supported")

s = Series(np.random.uniform(size=50))
s[0] = np.nan
axes = _check_plot_works(s.plot.kde)
Expand Down Expand Up @@ -638,6 +647,9 @@ def test_hist_kwargs(self):

@pytest.mark.slow
def test_hist_kde_color(self):
if not self.mpl_ge_1_5_0:
pytest.skip("mpl is not supported")

_, ax = self.plt.subplots()
ax = self.ts.plot.hist(logy=True, bins=10, color='b', ax=ax)
self._check_ax_scales(ax, yaxis='log')
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/series/test_rank.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class TestSeriesRank(TestData):

def test_rank(self):
tm._skip_if_no_scipy()
pytest.importorskip('scipy.stats.special')
from scipy.stats import rankdata

self.ts[::2] = np.nan
Expand Down Expand Up @@ -248,6 +249,7 @@ def _check(s, expected, method='average'):
def test_rank_methods_series(self):
tm.skip_if_no_package('scipy', min_version='0.13',
app='scipy.stats.rankdata')
pytest.importorskip('scipy.stats.special')
import scipy
from scipy.stats import rankdata

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/test_resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ def test_resample_dtype_preservation(self):

def test_resample_dtype_coerceion(self):

pytest.importorskip('scipy')
pytest.importorskip('scipy.interpolate')

# GH 16361
df = {"a": [1, 3, 1, 4]}
Expand Down

0 comments on commit ada6834

Please sign in to comment.