MCPcopy
hub / github.com/pytest-dev/pytest / snap

Method snap

src/_pytest/capture.py:567–573  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

565 EMPTY_BUFFER = b""
566
567 def snap(self) -> bytes:
568 self._assert_state("snap", ("started", "suspended"))
569 self.tmpfile.seek(0)
570 res = self.tmpfile.buffer.read()
571 self.tmpfile.seek(0)
572 self.tmpfile.truncate()
573 return res # type: ignore[return-value]
574
575 def writeorg(self, data: bytes) -> None:
576 """Write to original file descriptor."""

Calls 4

seekMethod · 0.80
truncateMethod · 0.80
_assert_stateMethod · 0.45
readMethod · 0.45