MCPcopy Index your code
hub / github.com/pydata/xarray / test_compute_false

Method test_compute_false

xarray/tests/test_backends_datatree.py:305–319  ·  view source on GitHub ↗
(self, tmpdir, simple_datatree)

Source from the content-addressed store, hash-verified

303
304 @requires_dask
305 def test_compute_false(self, tmpdir, simple_datatree):
306 filepath = tmpdir / "test.nc"
307 original_dt = simple_datatree.chunk()
308 result = original_dt.to_netcdf(filepath, engine=self.engine, compute=False)
309
310 if not ON_WINDOWS:
311 # File at filepath is not closed until .compute() is called. On
312 # Windows, this means we can't open it yet.
313 with open_datatree(filepath, engine=self.engine) as in_progress_dt:
314 assert in_progress_dt.isomorphic(original_dt)
315 assert not in_progress_dt.equals(original_dt)
316
317 result.compute()
318 with open_datatree(filepath, engine=self.engine) as written_dt:
319 assert_identical(written_dt, original_dt)
320
321 def test_default_write_engine(self, tmpdir, simple_datatree, monkeypatch):
322 # Ensure the other netCDF library are not installed

Callers

nothing calls this directly

Calls 7

open_datatreeFunction · 0.90
assert_identicalFunction · 0.90
isomorphicMethod · 0.80
chunkMethod · 0.45
to_netcdfMethod · 0.45
equalsMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected