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

Method test_new_clears_state

tests/test_base.py:51–66  ·  view source on GitHub ↗

Calling new() on a logger clears the context.

(self)

Source from the content-addressed store, hash-verified

49 assert b._context != b1._context != b2._context
50
51 def test_new_clears_state(self):
52 """
53 Calling new() on a logger clears the context.
54 """
55 b = build_bl()
56 b = b.bind(x=42)
57
58 assert 42 == get_context(b)["x"]
59
60 b = b.bind()
61
62 assert 42 == get_context(b)["x"]
63
64 b = b.new()
65
66 assert {} == dict(get_context(b))
67
68 def test_comparison(self):
69 """

Callers

nothing calls this directly

Calls 4

get_contextFunction · 0.90
build_blFunction · 0.70
bindMethod · 0.45
newMethod · 0.45

Tested by

no test coverage detected