Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX/TST: update tests for pandas 0.21 #9726

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 1 commit into from
Nov 10, 2017
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: 1 addition & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,9 @@ install:
# if conda-forge gets a new pyqt, it might be nice to install it as well to have more backends
# https://github.com/conda-forge/conda-forge.github.io/issues/157#issuecomment-223536381
#
# n.b. pandas is pinned to <0.21 due to issue 9610
- conda create -q -n test-environment python=%PYTHON_VERSION%
msinttypes freetype=2.6 "libpng>=1.6.21,<1.7" zlib=1.2 tk=8.5
pip setuptools numpy mock "pandas<0.21.0" sphinx tornado
pip setuptools numpy mock pandas sphinx tornado
- activate test-environment
- echo %PYTHON_VERSION% %TARGET_ARCH%
# pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ env:
matrix:
include:
- python: 2.7
env: MOCK=mock NUMPY=numpy==1.7.1 PANDAS='pandas<0.21.0' NOSE=nose
env: MOCK=mock NUMPY=numpy==1.7.1 PANDAS=pandas NOSE=nose
- python: 3.4
env: PYTHON_ARGS=-OO
- python: 3.6
env: DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8 PANDAS='pandas<0.21.0'
env: DELETE_FONT_CACHE=1 INSTALL_PEP8=pytest-pep8 RUN_PEP8=--pep8 PANDAS=pandas
- python: "nightly"
env: PRE=--pre
- os: osx
Expand Down
25 changes: 10 additions & 15 deletions lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5049,6 +5049,8 @@ def test_broken_barh_empty():

def test_pandas_pcolormesh():
pd = pytest.importorskip('pandas')
from pandas.tseries import converter
converter.register()

time = pd.date_range('2000-01-01', periods=10)
depth = np.arange(20)
Expand All @@ -5060,6 +5062,8 @@ def test_pandas_pcolormesh():

def test_pandas_indexing_dates():
pd = pytest.importorskip('pandas')
from pandas.tseries import converter
converter.register()

dates = np.arange('2005-02', '2005-03', dtype='datetime64[D]')
values = np.sin(np.array(range(len(dates))))
Expand All @@ -5073,6 +5077,8 @@ def test_pandas_indexing_dates():

def test_pandas_errorbar_indexing():
pd = pytest.importorskip('pandas')
from pandas.tseries import converter
converter.register()

df = pd.DataFrame(np.random.uniform(size=(5, 4)),
columns=['x', 'y', 'xe', 'ye'],
Expand All @@ -5083,6 +5089,8 @@ def test_pandas_errorbar_indexing():

def test_pandas_indexing_hist():
pd = pytest.importorskip('pandas')
from pandas.tseries import converter
converter.register()

ser_1 = pd.Series(data=[1, 2, 2, 3, 3, 4, 4, 4, 4, 5])
ser_2 = ser_1.iloc[1:]
Expand All @@ -5093,6 +5101,8 @@ def test_pandas_indexing_hist():
def test_pandas_bar_align_center():
# Tests fix for issue 8767
pd = pytest.importorskip('pandas')
from pandas.tseries import converter
converter.register()

df = pd.DataFrame({'a': range(2), 'b': range(2)})

Expand All @@ -5105,21 +5115,6 @@ def test_pandas_bar_align_center():
fig.canvas.draw()


def test_pandas_bar_align_center():
# Tests fix for issue 8767
pd = pytest.importorskip('pandas')

df = pd.DataFrame({'a': range(2), 'b': range(2)})

fig, ax = plt.subplots(1)

rect = ax.barh(df.loc[df['a'] == 1, 'b'],
df.loc[df['a'] == 1, 'b'],
align='center')

fig.canvas.draw()


def test_axis_set_tick_params_labelsize_labelcolor():
# Tests fix for issue 4346
axis_1 = plt.subplot()
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,8 @@ def test_date2num_dst_pandas():
# Test for github issue #3896, but in date2num around DST transitions
# with a timezone-aware pandas date_range object.
pd = pytest.importorskip('pandas')
from pandas.tseries import converter
converter.register()

def tz_convert(*args):
return pd.DatetimeIndex.tz_convert(*args).astype(object)
Expand Down