From 36a34e776b3d30bd0d94d7d14ae5d9f1ee777a52 Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Tue, 15 May 2018 19:21:05 -0700 Subject: [PATCH 1/2] Fix test suite with pandas 0.23 --- xarray/tests/test_dataset.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index b99f7ea1eec..3335a55e4ab 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -1848,7 +1848,9 @@ def test_drop_index_labels(self): expected = data.isel(x=slice(0, 0)) assert_identical(expected, actual) - with pytest.raises(ValueError): + # This exception raised by pandas changed from ValueError -> KeyError + # in pandas 0.23. + with pytest.raises((ValueError, KeyError)): # not contained in axis data.drop(['c'], dim='x') From 03db015d93346adf458adb26461033d0c4bc6aab Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Tue, 15 May 2018 20:06:20 -0700 Subject: [PATCH 2/2] Disable -OO check --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e375f6fb063..bd53edb0029 100644 --- a/.travis.yml +++ b/.travis.yml @@ -101,7 +101,9 @@ install: - python xarray/util/print_versions.py script: - - python -OO -c "import xarray" + # TODO: restore this check once the upstream pandas issue is fixed: + # https://github.com/pandas-dev/pandas/issues/21071 + # - python -OO -c "import xarray" - if [[ "$CONDA_ENV" == "docs" ]]; then conda install -c conda-forge sphinx sphinx_rtd_theme sphinx-gallery numpydoc; sphinx-build -n -j auto -b html -d _build/doctrees doc _build/html;