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

Method test_nested_explicit

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

Source from the content-addressed store, hash-verified

242 ])
243
244 def test_nested_explicit(self):
245 # Logging levels in a nested namespace, all explicitly set.
246 m = self.next_message
247
248 INF = logging.getLogger("INF")
249 INF.setLevel(logging.INFO)
250 INF_ERR = logging.getLogger("INF.ERR")
251 INF_ERR.setLevel(logging.ERROR)
252
253 # These should log.
254 INF_ERR.log(logging.CRITICAL, m())
255 INF_ERR.error(m())
256
257 # These should not log.
258 INF_ERR.warning(m())
259 INF_ERR.info(m())
260 INF_ERR.debug(m())
261
262 self.assert_log_lines([
263 ('INF.ERR', 'CRITICAL', '1'),
264 ('INF.ERR', 'ERROR', '2'),
265 ])
266
267 def test_nested_inherited(self):
268 # Logging levels in a nested namespace, inherited from parent loggers.

Callers

nothing calls this directly

Calls 9

getLoggerMethod · 0.80
assert_log_linesMethod · 0.80
mFunction · 0.50
setLevelMethod · 0.45
logMethod · 0.45
errorMethod · 0.45
warningMethod · 0.45
infoMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected