MCPcopy Index your code
hub / github.com/numpy/numpy / test_exceptions

Method test_exceptions

numpy/lib/tests/test_arraypad.py:104–111  ·  view source on GitHub ↗

Ensure faulty usage is discovered.

(self)

Source from the content-addressed store, hash-verified

102 _as_pairs(x, 10, as_index=True)
103
104 def test_exceptions(self):
105 """Ensure faulty usage is discovered."""
106 with pytest.raises(ValueError, match="more dimensions than allowed"):
107 _as_pairs([[[3]]], 10)
108 with pytest.raises(ValueError, match="could not be broadcast"):
109 _as_pairs([[1, 2], [3, 4]], 3)
110 with pytest.raises(ValueError, match="could not be broadcast"):
111 _as_pairs(np.ones((2, 3)), 3)
112
113
114class TestConditionalShortcuts:

Callers

nothing calls this directly

Calls 1

_as_pairsFunction · 0.90

Tested by

no test coverage detected