tmp_bind works with a BoundLoggerLazyProxy -- i.e. before the first bind.
(self)
| 109 | assert {"y": 23} == log._context._dict |
| 110 | |
| 111 | def test_tmp_bind_lazy(self): |
| 112 | """ |
| 113 | tmp_bind works with a BoundLoggerLazyProxy -- i.e. before the first |
| 114 | bind. |
| 115 | """ |
| 116 | with pytest.deprecated_call(): |
| 117 | structlog.configure(context_class=wrap_dict(dict)) |
| 118 | |
| 119 | log = get_logger() |
| 120 | |
| 121 | assert isinstance(log, BoundLoggerLazyProxy) |
| 122 | |
| 123 | with pytest.deprecated_call(), tmp_bind(log, x=42) as tmp_log: |
| 124 | assert {"x": 42} == tmp_log._context._dict |
| 125 | |
| 126 | assert {} == log._context |
| 127 | |
| 128 | |
| 129 | class TestAsImmutable: |
nothing calls this directly
no test coverage detected