Skip to content

Commit a1f272a

Browse files
Move test to tests/plotting
1 parent b5328a2 commit a1f272a

14 files changed

+25
-21
lines changed

pandas/plotting/compat.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,11 @@ def _mpl_ge_2_0_0():
4949
return matplotlib.__version__ >= LooseVersion('2.0')
5050
except ImportError:
5151
return False
52+
53+
54+
def _mpl_ge_2_0_1():
55+
try:
56+
import matplotlib
57+
return matplotlib.__version__ >= LooseVersion('2.0.1')
58+
except ImportError:
59+
return False

pandas/plotting/core.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@
3636
format_date_labels)
3737

3838

39-
40-
def _mpl_ge_2_0_1():
41-
try:
42-
import matplotlib
43-
return matplotlib.__version__ >= LooseVersion('2.0.1')
44-
except ImportError:
45-
return False
46-
47-
4839
if _mpl_ge_1_5_0():
4940
# Compat with mp 1.5, which uses cycler.
5041
import cycler
File renamed without changes.
File renamed without changes.

pandas/plotting/tests/test_boxplot_method.py renamed to pandas/tests/plotting/test_boxplot_method.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import pandas.plotting as plotting
1818

19-
from pandas.plotting.tests.common import (TestPlotBase, _check_plot_works)
19+
from pandas.tests.plotting.common import (TestPlotBase, _check_plot_works)
2020

2121

2222
""" Test cases for .boxplot method """

pandas/plotting/tests/test_datetimelike.py renamed to pandas/tests/plotting/test_datetimelike.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pandas.util.testing import assert_series_equal, ensure_clean, slow
1818
import pandas.util.testing as tm
1919

20-
from pandas.plotting.tests.common import (TestPlotBase,
20+
from pandas.tests.plotting.common import (TestPlotBase,
2121
_skip_if_no_scipy_gaussian_kde)
2222

2323

pandas/plotting/tests/test_deprecated.py renamed to pandas/tests/plotting/test_deprecated.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import pandas.tools.plotting as plotting
1414

15-
from pandas.plotting.tests.common import TestPlotBase
15+
from pandas.tests.plotting.common import TestPlotBase
1616

1717

1818
"""
@@ -62,6 +62,12 @@ def test_radviz_deprecated(self):
6262
with tm.assert_produces_warning(FutureWarning):
6363
plotting.radviz(frame=df, class_column='Name')
6464

65+
@slow
66+
def test_plot_params(self):
67+
68+
with tm.assert_produces_warning(FutureWarning):
69+
pd.plot_params['xaxis.compat'] = True
70+
6571

6672
if __name__ == '__main__':
6773
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],

pandas/plotting/tests/test_frame.py renamed to pandas/tests/plotting/test_frame.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from numpy.random import rand, randn
2424

2525
import pandas.plotting as plotting
26-
from pandas.plotting.tests.common import (TestPlotBase, _check_plot_works,
26+
from pandas.tests.plotting.common import (TestPlotBase, _check_plot_works,
2727
_skip_if_no_scipy_gaussian_kde,
2828
_ok_for_gaussian_kde)
2929

@@ -240,21 +240,21 @@ def test_xcompat(self):
240240
self.assertNotIsInstance(lines[0].get_xdata(), PeriodIndex)
241241

242242
tm.close()
243-
pd.plot_params['xaxis.compat'] = True
243+
pd.plotting.plot_params['xaxis.compat'] = True
244244
ax = df.plot()
245245
lines = ax.get_lines()
246246
self.assertNotIsInstance(lines[0].get_xdata(), PeriodIndex)
247247

248248
tm.close()
249-
pd.plot_params['x_compat'] = False
249+
pd.plotting.plot_params['x_compat'] = False
250250
ax = df.plot()
251251
lines = ax.get_lines()
252252
self.assertNotIsInstance(lines[0].get_xdata(), PeriodIndex)
253253
self.assertIsInstance(PeriodIndex(lines[0].get_xdata()), PeriodIndex)
254254

255255
tm.close()
256256
# useful if you're plotting a bunch together
257-
with pd.plot_params.use('x_compat', True):
257+
with pd.plotting.plot_params.use('x_compat', True):
258258
ax = df.plot()
259259
lines = ax.get_lines()
260260
self.assertNotIsInstance(lines[0].get_xdata(), PeriodIndex)

pandas/plotting/tests/test_groupby.py renamed to pandas/tests/plotting/test_groupby.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import numpy as np
1010

11-
from pandas.plotting.tests.common import TestPlotBase
11+
from pandas.tests.plotting.common import TestPlotBase
1212

1313

1414
@tm.mplskip

pandas/plotting/tests/test_hist_method.py renamed to pandas/tests/plotting/test_hist_method.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from numpy.random import randn
1111

1212
import pandas.plotting as plotting
13-
from pandas.plotting.tests.common import (TestPlotBase, _check_plot_works)
13+
from pandas.tests.plotting.common import (TestPlotBase, _check_plot_works)
1414

1515

1616
@tm.mplskip

pandas/plotting/tests/test_misc.py renamed to pandas/tests/plotting/test_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from numpy.random import randn
1313

1414
import pandas.plotting as plotting
15-
from pandas.plotting.tests.common import (TestPlotBase, _check_plot_works,
15+
from pandas.tests.plotting.common import (TestPlotBase, _check_plot_works,
1616
_ok_for_gaussian_kde)
1717

1818

pandas/plotting/tests/test_series.py renamed to pandas/tests/plotting/test_series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from numpy.random import randn
1818

1919
import pandas.plotting as plotting
20-
from pandas.plotting.tests.common import (TestPlotBase, _check_plot_works,
20+
from pandas.tests.plotting.common import (TestPlotBase, _check_plot_works,
2121
_skip_if_no_scipy_gaussian_kde,
2222
_ok_for_gaussian_kde)
2323

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,6 @@ def pxd(name):
675675
'pandas.tests.tools',
676676
'pandas.tests.types',
677677
'pandas.tests.plotting',
678-
'pandas.tests.test_msgpack',
679678
'pandas.tools',
680679
'pandas.tseries',
681680
'pandas.types',

0 commit comments

Comments
 (0)