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

Method test_assignment_errors

numpy/core/tests/test_multiarray.py:559–569  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

557 assert_raises(ValueError, assign, a, np.arange(12).reshape(2, 2, 3))
558
559 def test_assignment_errors(self):
560 # Address issue #2276
561 class C:
562 pass
563 a = np.zeros(1)
564
565 def assign(v):
566 a[0] = v
567
568 assert_raises((AttributeError, TypeError), assign, C())
569 assert_raises(ValueError, assign, [1])
570
571 def test_unicode_assignment(self):
572 # gh-5049

Callers

nothing calls this directly

Calls 2

assert_raisesFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected