MCPcopy Index your code
hub / github.com/RustPython/RustPython / LogCaptureHandler

Class LogCaptureHandler

Lib/test/test_support.py:29–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29class LogCaptureHandler(logging.StreamHandler):
30 # Inspired by pytest's caplog
31 def __init__(self):
32 super().__init__(io.StringIO())
33 self.records = []
34
35 def emit(self, record) -> None:
36 self.records.append(record)
37 super().emit(record)
38
39 def handleError(self, record):
40 raise
41
42
43@contextlib.contextmanager

Callers 1

_caplogFunction · 0.85

Calls

no outgoing calls

Tested by 1

_caplogFunction · 0.68