Configure and log an actual entry.
(self, capsys)
| 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]) |
nothing calls this directly
no test coverage detected