(self, tmpdir, simple_datatree)
| 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 |
nothing calls this directly
no test coverage detected