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

Method test_log_dict

tests/test_stdlib.py:1152–1163  ·  view source on GitHub ↗

dicts can be logged with std library loggers.

(self, capsys)

Source from the content-addressed store, hash-verified

1150 assert positional_args == event_dict["positional_args"]
1151
1152 def test_log_dict(self, capsys):
1153 """
1154 dicts can be logged with std library loggers.
1155 """
1156 configure_logging(None)
1157
1158 logging.getLogger().warning({"foo": "bar"})
1159
1160 assert (
1161 "",
1162 "{'foo': 'bar'} [in test_log_dict]\n",
1163 ) == capsys.readouterr()
1164
1165 def test_foreign_pre_chain(self, capsys):
1166 """

Callers

nothing calls this directly

Calls 2

configure_loggingFunction · 0.85
warningMethod · 0.45

Tested by

no test coverage detected