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

Method test_integration

tests/test_stdlib.py:1644–1665  ·  view source on GitHub ↗

Configure and log an actual entry.

(self, capsys)

Source from the content-addressed store, hash-verified

1642
1643 @pytest.mark.asyncio
1644 async def test_integration(self, capsys):
1645 """
1646 Configure and log an actual entry.
1647 """
1648
1649 configure(
1650 processors=[add_log_level, JSONRenderer()],
1651 logger_factory=PrintLogger,
1652 wrapper_class=AsyncBoundLogger,
1653 cache_logger_on_first_use=True,
1654 )
1655
1656 logger = get_logger()
1657
1658 await logger.bind(foo="bar").info("baz", x="42")
1659
1660 assert {
1661 "foo": "bar",
1662 "x": "42",
1663 "event": "baz",
1664 "level": "info",
1665 } == json.loads(capsys.readouterr().out)
1666
1667
1668@pytest.mark.parametrize("log_level", [None, 45])

Callers

nothing calls this directly

Calls 5

configureFunction · 0.90
JSONRendererClass · 0.90
get_loggerFunction · 0.90
infoMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected