/snap/core22/2411/usr/lib/python3.10/test/support
NameSizeModeActions
__pycache__/-0755rm
bytecode_helper.py16470644editdlrm
hashlib_helper.py19070644editdlrm
import_helper.py77360644editdlrm
interpreters.py58290644editdlrm
logging_helper.py9160644editdlrm
os_helper.py199640644editdlrm
script_helper.py114090644editdlrm
socket_helper.py114740644editdlrm
testresult.py59980644editdlrm
threading_helper.py66500644editdlrm
warnings_helper.py65930644editdlrm
__init__.py716070644editdlrm
Edit: /snap/core22/2411/usr/lib/python3.10/test/support/logging_helper.py (916B)
import logging.handlers class TestHandler(logging.handlers.BufferingHandler): def __init__(self, matcher): # BufferingHandler takes a "capacity" argument # so as to know when to flush. As we're overriding # shouldFlush anyway, we can set a capacity of zero. # You can call flush() manually to clear out the # buffer. logging.handlers.BufferingHandler.__init__(self, 0) self.matcher = matcher def shouldFlush(self): return False def emit(self, record): self.format(record) self.buffer.append(record.__dict__) def matches(self, **kwargs): """ Look for a saved dict whose keys/values match the supplied arguments. """ result = False for d in self.buffer: if self.matcher.matches(d, **kwargs): result = True break return result