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

Method test_copies_context_before_processing

tests/test_base.py:147–160  ·  view source on GitHub ↗

BoundLoggerBase._process_event() gets called before relaying events to wrapped loggers.

(self)

Source from the content-addressed store, hash-verified

145 assert {"event": "", "foo": "bar"} == kw
146
147 def test_copies_context_before_processing(self):
148 """
149 BoundLoggerBase._process_event() gets called before relaying events
150 to wrapped loggers.
151 """
152
153 def chk(_, __, event_dict):
154 assert b._context is not event_dict
155 return ""
156
157 b = build_bl(processors=[chk])
158
159 assert (("",), {}) == b._process_event("", "event", {})
160 assert "event" not in b._context
161
162 def test_chain_does_not_swallow_all_exceptions(self):
163 """

Callers

nothing calls this directly

Calls 2

_process_eventMethod · 0.80
build_blFunction · 0.70

Tested by

no test coverage detected