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

Class UnreliableArray

xarray/tests/test_backends.py:404–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402 pass
403
404 class UnreliableArray:
405 def __init__(self, array, failures=1):
406 self.array = array
407 self.failures = failures
408
409 def __getitem__(self, key):
410 if self.failures > 0:
411 self.failures -= 1
412 raise UnreliableArrayFailure
413 return self.array[key]
414
415 array = UnreliableArray([0])
416 with pytest.raises(UnreliableArrayFailure):

Callers 1

test_robust_getitemMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_robust_getitemMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…