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

Method snap

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

Source from the content-addressed store, hash-verified

448 EMPTY_BUFFER = ""
449
450 def snap(self) -> str:
451 self._assert_state("snap", ("started", "suspended"))
452 assert isinstance(self.tmpfile, CaptureIO)
453 res = self.tmpfile.getvalue()
454 self.tmpfile.seek(0)
455 self.tmpfile.truncate()
456 return res
457
458 def writeorg(self, data: str) -> None:
459 self._assert_state("writeorg", ("started", "suspended"))

Callers

nothing calls this directly

Calls 4

seekMethod · 0.80
truncateMethod · 0.80
_assert_stateMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected