From 58218ff50bea7bc89f7375bfce56151f202d825e Mon Sep 17 00:00:00 2001 From: dcherian Date: Sat, 28 Jul 2018 19:21:50 -0700 Subject: [PATCH] Make sure dask tests work with dask=0.16 --- xarray/tests/test_dask.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xarray/tests/test_dask.py b/xarray/tests/test_dask.py index e64d114296d..9b72a39e406 100644 --- a/xarray/tests/test_dask.py +++ b/xarray/tests/test_dask.py @@ -24,8 +24,11 @@ class DaskTestCase(TestCase): def assertLazyAnd(self, expected, actual, test): - with dask.config.set(get=dask.get): + + with (dask.config.set(get=dask.get) if hasattr(dask, 'config') + else dask.set_options(get=dask.get)): test(actual, expected) + if isinstance(actual, Dataset): for k, v in actual.variables.items(): if k in actual.dims: @@ -824,7 +827,8 @@ def test_basic_compute(): dask.multiprocessing.get, dask.local.get_sync, None]: - with dask.config.set(get=get): + with (dask.config.set(get=dask.get) if hasattr(dask, 'config') + else dask.set_options(get=dask.get)): ds.compute() ds.foo.compute() ds.foo.variable.compute()