From 78522749e60b64f4ff77892e65425c31659fce9b Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Tue, 27 Mar 2018 22:36:31 -0700 Subject: [PATCH 1/2] xfail tests that append to netCDF files with scipy These are broken by SciPy 1.0.1. For details, see https://github.com/pydata/xarray/issues/2019 --- xarray/tests/test_backends.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index 5b9bb2a0506..df4e80202bd 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -1404,8 +1404,23 @@ def create_zarr_target(self): yield tmp +class ScipyTest(CFEncodedDataTest, NetCDF3Only): + + def test_append_write(self): + import scipy + if scipy.__version__ == '1.0.1': + pytest.xfail('https://github.com/scipy/scipy/issues/8625') + super(ScipyTest, self).test_append_write() + + def test_append_overwrite_values(self): + import scipy + if scipy.__version__ == '1.0.1': + pytest.xfail('https://github.com/scipy/scipy/issues/8625') + super(ScipyTest, self).test_append_overwrite_values() + + @requires_scipy -class ScipyInMemoryDataTest(CFEncodedDataTest, NetCDF3Only, TestCase): +class ScipyInMemoryDataTest(ScipyTest, TestCase): engine = 'scipy' @contextlib.contextmanager @@ -1431,7 +1446,7 @@ class ScipyInMemoryDataTestAutocloseTrue(ScipyInMemoryDataTest): @requires_scipy -class ScipyFileObjectTest(CFEncodedDataTest, NetCDF3Only, TestCase): +class ScipyFileObjectTest(ScipyTest, TestCase): engine = 'scipy' @contextlib.contextmanager @@ -1459,7 +1474,7 @@ def test_pickle_dataarray(self): @requires_scipy -class ScipyFilePathTest(CFEncodedDataTest, NetCDF3Only, TestCase): +class ScipyFilePathTest(ScipyTest, TestCase): engine = 'scipy' @contextlib.contextmanager From 63a6e6394f287e7b5f7357b0d452b099def5f1da Mon Sep 17 00:00:00 2001 From: Stephan Hoyer Date: Wed, 28 Mar 2018 08:37:54 -0700 Subject: [PATCH 2/2] xfail pynio tests that use scipy too --- xarray/tests/test_backends.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xarray/tests/test_backends.py b/xarray/tests/test_backends.py index df4e80202bd..0bef13a8c43 100644 --- a/xarray/tests/test_backends.py +++ b/xarray/tests/test_backends.py @@ -1404,23 +1404,23 @@ def create_zarr_target(self): yield tmp -class ScipyTest(CFEncodedDataTest, NetCDF3Only): +class ScipyWriteTest(CFEncodedDataTest, NetCDF3Only): def test_append_write(self): import scipy if scipy.__version__ == '1.0.1': pytest.xfail('https://github.com/scipy/scipy/issues/8625') - super(ScipyTest, self).test_append_write() + super(ScipyWriteTest, self).test_append_write() def test_append_overwrite_values(self): import scipy if scipy.__version__ == '1.0.1': pytest.xfail('https://github.com/scipy/scipy/issues/8625') - super(ScipyTest, self).test_append_overwrite_values() + super(ScipyWriteTest, self).test_append_overwrite_values() @requires_scipy -class ScipyInMemoryDataTest(ScipyTest, TestCase): +class ScipyInMemoryDataTest(ScipyWriteTest, TestCase): engine = 'scipy' @contextlib.contextmanager @@ -1446,7 +1446,7 @@ class ScipyInMemoryDataTestAutocloseTrue(ScipyInMemoryDataTest): @requires_scipy -class ScipyFileObjectTest(ScipyTest, TestCase): +class ScipyFileObjectTest(ScipyWriteTest, TestCase): engine = 'scipy' @contextlib.contextmanager @@ -1474,7 +1474,7 @@ def test_pickle_dataarray(self): @requires_scipy -class ScipyFilePathTest(ScipyTest, TestCase): +class ScipyFilePathTest(ScipyWriteTest, TestCase): engine = 'scipy' @contextlib.contextmanager @@ -2183,7 +2183,7 @@ def test_session(self): @requires_scipy @requires_pynio -class TestPyNio(CFEncodedDataTest, NetCDF3Only, TestCase): +class PyNioTest(ScipyWriteTest, TestCase): def test_write_store(self): # pynio is read-only for now pass @@ -2209,7 +2209,7 @@ def test_weakrefs(self): assert_identical(actual, expected) -class TestPyNioAutocloseTrue(TestPyNio): +class PyNioTestAutocloseTrue(PyNioTest): autoclose = True