MCPcopy
hub / github.com/pydata/xarray / test_warn_ds_dims_deprecation

Method test_warn_ds_dims_deprecation

xarray/tests/test_dataset.py:757–776  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

755 )
756
757 def test_warn_ds_dims_deprecation(self) -> None:
758 # TODO remove after deprecation cycle in GH #8500 is complete
759 ds = create_test_data()
760
761 with pytest.warns(FutureWarning, match="return type"):
762 ds.dims["dim1"]
763
764 with pytest.warns(FutureWarning, match="return type"):
765 ds.dims.keys()
766
767 with pytest.warns(FutureWarning, match="return type"):
768 ds.dims.values()
769
770 with pytest.warns(FutureWarning, match="return type"):
771 ds.dims.items()
772
773 with assert_no_warnings():
774 len(ds.dims)
775 ds.dims.__iter__()
776 _ = "dim1" in ds.dims
777
778 def test_asarray(self) -> None:
779 ds = Dataset({"x": 0})

Callers

nothing calls this directly

Calls 6

create_test_dataFunction · 0.90
assert_no_warningsFunction · 0.90
keysMethod · 0.80
itemsMethod · 0.80
valuesMethod · 0.45
__iter__Method · 0.45

Tested by

no test coverage detected