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

Method snap

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

Source from the content-addressed store, hash-verified

430 EMPTY_BUFFER = b""
431
432 def snap(self) -> bytes:
433 self._assert_state("snap", ("started", "suspended"))
434 self.tmpfile.seek(0)
435 res = self.tmpfile.buffer.read()
436 self.tmpfile.seek(0)
437 self.tmpfile.truncate()
438 return res
439
440 def writeorg(self, data: bytes) -> None:
441 self._assert_state("writeorg", ("started", "suspended"))

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected