MCPcopy
hub / github.com/Delgan/loguru / test_configure_before_bind

Function test_configure_before_bind

tests/test_configure.py:191–203  ·  view source on GitHub ↗
(writer)

Source from the content-addressed store, hash-verified

189
190
191def test_configure_before_bind(writer):
192 logger.configure(extra={"a": "default_a", "b": "default_b"})
193 logger.add(writer, format="{extra[a]} {extra[b]} {message}")
194
195 logger.debug("init")
196
197 logger_a = logger.bind(a="A")
198 logger_b = logger.bind(b="B")
199
200 logger_a.debug("aaa")
201 logger_b.debug("bbb")
202
203 assert writer.read() == ("default_a default_b init\n" "A default_b aaa\n" "default_a B bbb\n")
204
205
206def test_configure_after_bind(writer):

Callers

nothing calls this directly

Calls 5

configureMethod · 0.80
addMethod · 0.80
debugMethod · 0.80
bindMethod · 0.80
readMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…