MCPcopy Index your code
hub / github.com/python/cpython / _caplog

Function _caplog

Lib/test/test_support.py:47–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45
46@contextlib.contextmanager
47def _caplog():
48 handler = LogCaptureHandler()
49 root_logger = logging.getLogger()
50 root_logger.addHandler(handler)
51 try:
52 yield handler
53 finally:
54 root_logger.removeHandler(handler)
55
56
57class TestSupport(unittest.TestCase):

Calls 4

LogCaptureHandlerClass · 0.85
getLoggerMethod · 0.80
addHandlerMethod · 0.80
removeHandlerMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…