Skip to content

Commit 9f58d50

Browse files
authored
Fix test suite with pandas 0.23 (#2136)
* Fix test suite with pandas 0.23 * Disable -OO check
1 parent 3df3023 commit 9f58d50

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ install:
101101
- python xarray/util/print_versions.py
102102

103103
script:
104-
- python -OO -c "import xarray"
104+
# TODO: restore this check once the upstream pandas issue is fixed:
105+
# https://github.com/pandas-dev/pandas/issues/21071
106+
# - python -OO -c "import xarray"
105107
- if [[ "$CONDA_ENV" == "docs" ]]; then
106108
conda install -c conda-forge sphinx sphinx_rtd_theme sphinx-gallery numpydoc;
107109
sphinx-build -n -j auto -b html -d _build/doctrees doc _build/html;

xarray/tests/test_dataset.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,9 @@ def test_drop_index_labels(self):
18481848
expected = data.isel(x=slice(0, 0))
18491849
assert_identical(expected, actual)
18501850

1851-
with pytest.raises(ValueError):
1851+
# This exception raised by pandas changed from ValueError -> KeyError
1852+
# in pandas 0.23.
1853+
with pytest.raises((ValueError, KeyError)):
18521854
# not contained in axis
18531855
data.drop(['c'], dim='x')
18541856

0 commit comments

Comments
 (0)