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

Method snap

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

Source from the content-addressed store, hash-verified

395 self._state = "started"
396
397 def snap(self):
398 self._assert_state("snap", ("started", "suspended"))
399 self.tmpfile.seek(0)
400 res = self.tmpfile.buffer.read()
401 self.tmpfile.seek(0)
402 self.tmpfile.truncate()
403 return res
404
405 def done(self) -> None:
406 """Stop capturing, restore streams, return original capture file,

Calls 2

_assert_stateMethod · 0.95
readMethod · 0.45