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

Method test_writeable

numpy/lib/tests/test_stride_tricks.py:491–502  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

489 sliding_window_view(arr, (5, 5))
490
491 def test_writeable(self):
492 arr = np.arange(5)
493 view = sliding_window_view(arr, 2, writeable=False)
494 assert_(not view.flags.writeable)
495 with pytest.raises(
496 ValueError,
497 match='assignment destination is read-only'):
498 view[0, 0] = 3
499 view = sliding_window_view(arr, 2, writeable=True)
500 assert_(view.flags.writeable)
501 view[0, 1] = 3
502 assert_array_equal(arr, np.array([0, 3, 2, 3, 4]))
503
504 def test_subok(self):
505 class MyArray(np.ndarray):

Callers

nothing calls this directly

Calls 3

sliding_window_viewFunction · 0.90
assert_Function · 0.90
assert_array_equalFunction · 0.90

Tested by

no test coverage detected