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

Method test_open_mfdataset_with_warn

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

Source from the content-addressed store, hash-verified

6091 assert_identical(original, actual)
6092
6093 def test_open_mfdataset_with_warn(self) -> None:
6094 original = Dataset({"foo": ("x", np.random.randn(10))})
6095 with pytest.warns(UserWarning, match=r"Ignoring."):
6096 with create_tmp_files(2) as (tmp1, tmp2):
6097 ds1 = original.isel(x=slice(5))
6098 ds2 = original.isel(x=slice(5, 10))
6099 ds1.to_netcdf(tmp1)
6100 ds2.to_netcdf(tmp2)
6101 with open_mfdataset(
6102 [tmp1, "non-existent-file.nc", tmp2],
6103 concat_dim="x",
6104 combine="nested",
6105 errors="warn",
6106 ) as actual:
6107 assert_identical(original, actual)
6108
6109 def test_open_mfdataset_2d_with_ignore(self) -> None:
6110 original = Dataset({"foo": (["x", "y"], np.random.randn(10, 8))})

Callers

nothing calls this directly

Calls 6

iselMethod · 0.95
DatasetClass · 0.90
open_mfdatasetFunction · 0.90
assert_identicalFunction · 0.90
create_tmp_filesFunction · 0.85
to_netcdfMethod · 0.45

Tested by

no test coverage detected