new/bind/unbind/try_unbind are correctly propagated.
(self, cl)
| 1611 | |
| 1612 | @pytest.mark.asyncio |
| 1613 | async def test_bind_unbind(self, cl): |
| 1614 | """ |
| 1615 | new/bind/unbind/try_unbind are correctly propagated. |
| 1616 | """ |
| 1617 | l1 = AsyncBoundLogger(cl, context={}, processors=[]) |
| 1618 | |
| 1619 | l2 = l1.bind(x=42) |
| 1620 | |
| 1621 | assert l1 is not l2 |
| 1622 | assert l1.sync_bl is not l2.sync_bl |
| 1623 | assert {} == l1._context |
| 1624 | assert {"x": 42} == l2._context |
| 1625 | |
| 1626 | l3 = l2.new(y=23) |
| 1627 | |
| 1628 | assert l2 is not l3 |
| 1629 | assert l2.sync_bl is not l3.sync_bl |
| 1630 | assert {"y": 23} == l3._context |
| 1631 | |
| 1632 | l4 = l3.unbind("y") |
| 1633 | |
| 1634 | assert {} == l4._context |
| 1635 | assert l3 is not l4 |
| 1636 | |
| 1637 | # N.B. x isn't bound anymore. |
| 1638 | l5 = l4.try_unbind("x") |
| 1639 | |
| 1640 | assert {} == l5._context |
| 1641 | assert l4 is not l5 |
| 1642 | |
| 1643 | @pytest.mark.asyncio |
| 1644 | async def test_integration(self, capsys): |
nothing calls this directly
no test coverage detected