MCPcopy Create free account
hub / github.com/hynek/structlog / test_is_enabled_for

Method test_is_enabled_for

tests/test_stdlib.py:306–316  ·  view source on GitHub ↗

is_enabled_for is a snake_case alias that delegates to the wrapped logger's isEnabledFor, for compatibility with FilteringBoundLogger.

(self)

Source from the content-addressed store, hash-verified

304 assert called_stdlib_method[0] is True
305
306 def test_is_enabled_for(self):
307 """
308 is_enabled_for is a snake_case alias that delegates to the wrapped
309 logger's isEnabledFor, for compatibility with FilteringBoundLogger.
310 """
311 stdlib_logger = logging.getLogger("test_is_enabled_for")
312 stdlib_logger.setLevel(WARN)
313 bl = BoundLogger(stdlib_logger, [], {})
314
315 assert bl.is_enabled_for(WARN) is True
316 assert bl.is_enabled_for(DEBUG) is False
317
318 def test_get_effective_level(self):
319 """

Callers

nothing calls this directly

Calls 3

is_enabled_forMethod · 0.95
BoundLoggerClass · 0.90
setLevelMethod · 0.80

Tested by

no test coverage detected