|
12 | 12 | from pandas import Index, Period, Series, Timestamp, date_range
|
13 | 13 | import pandas.util.testing as tm
|
14 | 14 |
|
| 15 | +from pandas.plotting import ( |
| 16 | + deregister_matplotlib_converters, register_matplotlib_converters) |
15 | 17 | from pandas.tseries.offsets import Day, Micro, Milli, Second
|
16 | 18 |
|
17 |
| -converter = pytest.importorskip('pandas.plotting._matplotlib.converter') |
18 |
| -from pandas.plotting import (deregister_matplotlib_converters, # isort:skip |
19 |
| - register_matplotlib_converters) |
| 19 | +try: |
| 20 | + from pandas.plotting._matplotlib import converter |
| 21 | +except ImportError: |
| 22 | + # try / except, rather than skip, to avoid internal refactoring |
| 23 | + # causing an improprer skip |
| 24 | + pass |
| 25 | + |
| 26 | +pytest.importorskip('matplotlib.pyplot') |
| 27 | + |
| 28 | + |
| 29 | +def test_initial_warning(): |
| 30 | + code = ( |
| 31 | + "import pandas as pd; import matplotlib.pyplot as plt; " |
| 32 | + "s = pd.Series(1, pd.date_range('2000', periods=12)); " |
| 33 | + "fig, ax = plt.subplots(); " |
| 34 | + "ax.plot(s.index, s.values)" |
| 35 | + ) |
| 36 | + call = [sys.executable, '-c', code] |
| 37 | + out = subprocess.check_output(call, stderr=subprocess.STDOUT).decode() |
| 38 | + assert 'Using an implicitly' in out |
20 | 39 |
|
21 | 40 |
|
22 | 41 | def test_timtetonum_accepts_unicode():
|
|
0 commit comments