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

Method test_contextmanager

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

Source from the content-addressed store, hash-verified

325 self.assertNotEqual(m, tp(self._source))
326
327 def test_contextmanager(self):
328 for tp in self._types:
329 b = tp(self._source)
330 m = self._view(b)
331 with m as cm:
332 self.assertIs(cm, m)
333 self._check_released(m, tp)
334 m = self._view(b)
335 # Can release explicitly inside the context manager
336 with m:
337 m.release()
338
339 def test_release(self):
340 for tp in self._types:

Callers

nothing calls this directly

Calls 4

_check_releasedMethod · 0.95
_viewMethod · 0.45
assertIsMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected