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

Method test_foreign_delegate

tests/test_stdlib.py:1106–1118  ·  view source on GitHub ↗

If foreign_pre_chain is None, non-structlog log entries are delegated to logging. The processor chain's event dict is invoked with `_from_structlog=False`

(self, capsys)

Source from the content-addressed store, hash-verified

1104 """
1105
1106 def test_foreign_delegate(self, capsys):
1107 """
1108 If foreign_pre_chain is None, non-structlog log entries are delegated
1109 to logging. The processor chain's event dict is invoked with
1110 `_from_structlog=False`
1111 """
1112 calls = configure_logging(None)
1113
1114 logging.getLogger().warning("foo")
1115
1116 assert ("", "foo [in test_foreign_delegate]\n") == capsys.readouterr()
1117 assert calls[0]["_from_structlog"] is False
1118 assert isinstance(calls[0]["_record"], logging.LogRecord)
1119
1120 def test_clears_args(self, capsys):
1121 """

Callers

nothing calls this directly

Calls 2

configure_loggingFunction · 0.85
warningMethod · 0.45

Tested by

no test coverage detected