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

Method test_native

tests/test_stdlib.py:1351–1364  ·  view source on GitHub ↗

If the log entry comes from structlog, it's unpackaged and processed.

(self, capsys)

Source from the content-addressed store, hash-verified

1349 assert 2 == err.count("Stack (most recent call last):")
1350
1351 def test_native(self, capsys):
1352 """
1353 If the log entry comes from structlog, it's unpackaged and processed.
1354 """
1355 eds = configure_logging(None)
1356
1357 get_logger().warning("foo")
1358
1359 assert (
1360 "",
1361 "[warning ] foo [in test_native]\n",
1362 ) == capsys.readouterr()
1363 assert eds[0]["_from_structlog"] is True
1364 assert isinstance(eds[0]["_record"], logging.LogRecord)
1365
1366 def test_native_logger(self, capsys):
1367 """

Callers

nothing calls this directly

Calls 3

get_loggerFunction · 0.90
configure_loggingFunction · 0.85
warningMethod · 0.45

Tested by

no test coverage detected