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

Method test_file_remains_open

xarray/tests/test_backends.py:2559–2568  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2557 engine: T_NetcdfEngine
2558
2559 def test_file_remains_open(self) -> None:
2560 data = Dataset({"foo": ("x", [1, 2, 3])})
2561 f = BytesIO()
2562 data.to_netcdf(f, engine=self.engine)
2563 assert not f.closed
2564 restored = open_dataset(f, engine=self.engine)
2565 assert not f.closed
2566 assert_identical(restored, data)
2567 restored.close()
2568 assert not f.closed
2569
2570
2571@requires_h5netcdf_or_netCDF4

Callers

nothing calls this directly

Calls 5

to_netcdfMethod · 0.95
DatasetClass · 0.90
open_datasetFunction · 0.90
assert_identicalFunction · 0.90
closeMethod · 0.45

Tested by

no test coverage detected