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

Method _check_released

Lib/test/test_memoryview.py:303–325  ·  view source on GitHub ↗
(self, m, tp)

Source from the content-addressed store, hash-verified

301 self.assertTrue(wr() is None, wr())
302
303 def _check_released(self, m, tp):
304 check = self.assertRaisesRegex(ValueError, "released")
305 with check: bytes(m)
306 with check: m.tobytes()
307 with check: m.tolist()
308 with check: m[0]
309 with check: m[0] = b'x'
310 with check: len(m)
311 with check: m.format
312 with check: m.itemsize
313 with check: m.ndim
314 with check: m.readonly
315 with check: m.shape
316 with check: m.strides
317 with check:
318 with m:
319 pass
320 # str() and repr() still function
321 self.assertIn("released memory", str(m))
322 self.assertIn("released memory", repr(m))
323 self.assertEqual(m, m)
324 self.assertNotEqual(m, memoryview(tp(self._source)))
325 self.assertNotEqual(m, tp(self._source))
326
327 def test_contextmanager(self):
328 for tp in self._types:

Callers 2

test_contextmanagerMethod · 0.95
test_releaseMethod · 0.95

Calls 9

lenFunction · 0.85
strFunction · 0.85
reprFunction · 0.85
assertRaisesRegexMethod · 0.80
assertInMethod · 0.80
assertNotEqualMethod · 0.80
tobytesMethod · 0.45
tolistMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected