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

Function test_exception_log_function

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

Source from the content-addressed store, hash-verified

107
108
109def test_exception_log_function(writer):
110 logger.add(writer, format="{level.no} {message}")
111
112 try:
113 1 / 0 # noqa: B018
114 except Exception:
115 logger.opt(exception=True).log(50, "Error")
116
117 lines = writer.read().strip().splitlines()
118
119 assert lines[0] == "50 Error"
120 assert lines[-1] == "ZeroDivisionError: division by zero"
121
122
123def test_lazy(writer):

Callers

nothing calls this directly

Calls 5

addMethod · 0.80
logMethod · 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…