Skip to content

Commit

Permalink
Make sure dask tests work with dask=0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Jul 29, 2018
1 parent 334c51b commit 5f0e251
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xarray/tests/test_dask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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=get) if hasattr(dask, 'config')
else dask.set_options(get=get)):
ds.compute()
ds.foo.compute()
ds.foo.variable.compute()

0 comments on commit 5f0e251

Please sign in to comment.