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

Method test_mixins_have_slots

numpy/ma/tests/test_subclassing.py:453–460  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

451 assert_equal(np.divide(m2, wm), np.divide(wm, m2))
452
453 def test_mixins_have_slots(self):
454 mixin = NDArrayOperatorsMixin()
455 # Should raise an error
456 assert_raises(AttributeError, mixin.__setattr__, "not_a_real_attr", 1)
457
458 m = np.ma.masked_array([1, 3, 5], mask=[False, True, False])
459 wm = WrappedArray(m)
460 assert_raises(AttributeError, wm.__setattr__, "not_an_attr", 2)

Callers

nothing calls this directly

Calls 3

assert_raisesFunction · 0.90
WrappedArrayClass · 0.85

Tested by

no test coverage detected