(self, m, tp)
| 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: |
no test coverage detected