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

Method test_get_merged

tests/test_threadlocal.py:417–428  ·  view source on GitHub ↗

Returns a copy of the threadlocal context merged with the logger's context.

(self)

Source from the content-addressed store, hash-verified

415 assert {} == get_threadlocal()
416
417 def test_get_merged(self):
418 """
419 Returns a copy of the threadlocal context merged with the logger's
420 context.
421 """
422 with pytest.deprecated_call():
423 bind_threadlocal(x=1)
424
425 log = structlog.get_logger().bind(y=2)
426
427 with pytest.deprecated_call():
428 assert {"x": 1, "y": 2} == get_merged_threadlocal(log)
429
430
431class TestBoundThreadlocal:

Callers

nothing calls this directly

Calls 3

bind_threadlocalFunction · 0.90
get_merged_threadlocalFunction · 0.90
bindMethod · 0.45

Tested by

no test coverage detected