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

Method test_exceptions

numpy/lib/tests/test_arraypad.py:105–112  ·  view source on GitHub ↗

Ensure faulty usage is discovered.

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

_as_pairsFunction · 0.90

Tested by

no test coverage detected