MCPcopy
hub / github.com/Delgan/loguru / test_exception_boolean

Function test_exception_boolean

tests/test_opt.py:63–74  ·  view source on GitHub ↗
(writer)

Source from the content-addressed store, hash-verified

61
62
63def test_exception_boolean(writer):
64 logger.add(writer, format="{level.name}: {message}")
65
66 try:
67 1 / 0 # noqa: B018
68 except Exception:
69 logger.opt(exception=True).debug("Error {0} {record}", 1, record="test")
70
71 lines = writer.read().strip().splitlines()
72
73 assert lines[0] == "DEBUG: Error 1 test"
74 assert lines[-1] == "ZeroDivisionError: division by zero"
75
76
77def test_exception_exc_info(writer):

Callers

nothing calls this directly

Calls 5

addMethod · 0.80
debugMethod · 0.80
optMethod · 0.80
readMethod · 0.80
stripMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…