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

Method setUp

Lib/test/test_logging.py:4230–4246  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4228class LogRecordFactoryTest(BaseTest):
4229
4230 def setUp(self):
4231 class CheckingFilter(logging.Filter):
4232 def __init__(self, cls):
4233 self.cls = cls
4234
4235 def filter(self, record):
4236 t = type(record)
4237 if t is not self.cls:
4238 msg = 'Unexpected LogRecord type %s, expected %s' % (t,
4239 self.cls)
4240 raise TypeError(msg)
4241 return True
4242
4243 BaseTest.setUp(self)
4244 self.filter = CheckingFilter(DerivedLogRecord)
4245 self.root_logger.addFilter(self.filter)
4246 self.orig_factory = logging.getLogRecordFactory()
4247
4248 def tearDown(self):
4249 self.root_logger.removeFilter(self.filter)

Callers

nothing calls this directly

Calls 3

CheckingFilterClass · 0.85
addFilterMethod · 0.80
setUpMethod · 0.45

Tested by

no test coverage detected