MCPcopy Create free account
hub / github.com/pydata/xarray / _roundtrip_with_warnings

Method _roundtrip_with_warnings

xarray/tests/test_backends.py:1213–1224  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

1211 def test_roundtrip_unsigned(self, fill_value, exp_fill_warning):
1212 @contextlib.contextmanager
1213 def _roundtrip_with_warnings(*args, **kwargs):
1214 is_np2 = module_available("numpy", minversion="2.0.0.dev0")
1215 if exp_fill_warning and is_np2:
1216 warn_checker: contextlib.AbstractContextManager = pytest.warns(
1217 SerializationWarning,
1218 match="_FillValue attribute can't be represented",
1219 )
1220 else:
1221 warn_checker = contextlib.nullcontext()
1222 with warn_checker:
1223 with self.roundtrip(*args, **kwargs) as actual:
1224 yield actual
1225
1226 # regression/numpy2 test for
1227 encoding = {

Callers

nothing calls this directly

Calls 2

module_availableFunction · 0.90
roundtripMethod · 0.45

Tested by

no test coverage detected