MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_toreadonly

Method test_toreadonly

Lib/test/test_memoryview.py:428–437  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

426 self.assertEqual(list(reversed(m)), list(m[::-1]))
427
428 def test_toreadonly(self):
429 for tp in self._types:
430 b = tp(self._source)
431 m = self._view(b)
432 mm = m.toreadonly()
433 self.assertTrue(mm.readonly)
434 self.assertTrue(memoryview(mm).readonly)
435 self.assertEqual(mm.tolist(), m.tolist())
436 mm.release()
437 m.tolist()
438
439 def test_issue22668(self):
440 a = array.array('H', [256, 256, 256, 256])

Callers

nothing calls this directly

Calls 6

toreadonlyMethod · 0.80
assertTrueMethod · 0.80
_viewMethod · 0.45
assertEqualMethod · 0.45
tolistMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected