MCPcopy Create free account
hub / github.com/numpy/numpy / test_zeros_like_errors

Function test_zeros_like_errors

numpy/array_api/tests/test_creation_functions.py:130–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128
129
130def test_zeros_like_errors():
131 zeros_like(asarray(1), device="cpu") # Doesn't error
132 assert_raises(ValueError, lambda: zeros_like(asarray(1), device="gpu"))
133 assert_raises(ValueError, lambda: zeros_like(asarray(1), dtype=int))
134 assert_raises(ValueError, lambda: zeros_like(asarray(1), dtype="i"))
135
136def test_meshgrid_dtype_errors():
137 # Doesn't raise

Callers

nothing calls this directly

Calls 3

assert_raisesFunction · 0.90
zeros_likeFunction · 0.50
asarrayFunction · 0.50

Tested by

no test coverage detected