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

Method test_captures

tests/test_testing.py:211–227  ·  view source on GitHub ↗

All calls to all names are captured.

(self)

Source from the content-addressed store, hash-verified

209 assert "<CapturingLogger with 2 call(s)>" == repr(cl)
210
211 def test_captures(self):
212 """
213 All calls to all names are captured.
214 """
215 cl = CapturingLogger()
216
217 cl.info("hi", val=42)
218 cl.trololo("yolo", foo={"bar": "baz"})
219
220 assert [
221 CapturedCall(method_name="info", args=("hi",), kwargs={"val": 42}),
222 CapturedCall(
223 method_name="trololo",
224 args=("yolo",),
225 kwargs={"foo": {"bar": "baz"}},
226 ),
227 ] == cl.calls

Callers

nothing calls this directly

Calls 3

CapturingLoggerClass · 0.90
CapturedCallClass · 0.90
infoMethod · 0.45

Tested by

no test coverage detected