MCPcopy Create free account
hub / github.com/pytest-dev/pytest / snap

Method snap

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

Source from the content-addressed store, hash-verified

272 self._state = "started"
273
274 def snap(self):
275 self._assert_state("snap", ("started", "suspended"))
276 self.tmpfile.seek(0)
277 res = self.tmpfile.buffer.read()
278 self.tmpfile.seek(0)
279 self.tmpfile.truncate()
280 return res
281
282 def done(self) -> None:
283 self._assert_state("done", ("initialized", "started", "suspended", "done"))

Callers

nothing calls this directly

Calls 2

_assert_stateMethod · 0.95
readMethod · 0.45

Tested by

no test coverage detected