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

Method test_exception

tests/test_stdlib.py:1581–1593  ·  view source on GitHub ↗

`exception` makes sure 'exc_info" is set, if it's not set already.

(self, abl, cl)

Source from the content-addressed store, hash-verified

1579
1580 @pytest.mark.asyncio
1581 async def test_exception(self, abl, cl):
1582 """
1583 `exception` makes sure 'exc_info" is set, if it's not set already.
1584 """
1585 try:
1586 raise ValueError("omg")
1587 except ValueError:
1588 await abl.exception("oops")
1589
1590 ei = cl.calls[0].kwargs["exc_info"]
1591
1592 assert ValueError is ei[0]
1593 assert ("omg",) == ei[1].args
1594
1595 @pytest.mark.asyncio
1596 async def test_exception_do_not_overwrite(self, abl, cl):

Callers

nothing calls this directly

Calls 1

exceptionMethod · 0.45

Tested by

no test coverage detected