We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 760c479 commit c689221Copy full SHA for c689221
src/idom/testing.py
@@ -281,16 +281,18 @@ def _raise_log_message_error(
281
282
283
@contextmanager
284
-def capture_idom_logs(use_existing: bool = False) -> Iterator[list[logging.LogRecord]]:
+def capture_idom_logs(
285
+ yield_existing: bool = False,
286
+) -> Iterator[list[logging.LogRecord]]:
287
"""Capture logs from IDOM
288
289
Parameters:
- use_existing:
290
+ yield_existing:
291
If already inside an existing capture context yield the same list of logs.
292
This is useful if you need to mutate the list of logs to affect behavior in
293
the outer context.
294
"""
- if use_existing:
295
+ if yield_existing:
296
for handler in reversed(ROOT_LOGGER.handlers):
297
if isinstance(handler, _LogRecordCaptor):
298
yield handler.records
0 commit comments