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

Method test_nested_explicit

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected