File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,7 @@ def assert_idom_logged(
197
197
error_pattern = re .compile (match_error )
198
198
199
199
try :
200
- with capture_idom_logs (use_existing = clear_matched_records ) as log_records :
200
+ with capture_idom_logs (yield_existing = clear_matched_records ) as log_records :
201
201
yield None
202
202
except Exception :
203
203
raise
@@ -281,16 +281,18 @@ def _raise_log_message_error(
281
281
282
282
283
283
@contextmanager
284
- def capture_idom_logs (use_existing : bool = False ) -> Iterator [list [logging .LogRecord ]]:
284
+ def capture_idom_logs (
285
+ yield_existing : bool = False ,
286
+ ) -> Iterator [list [logging .LogRecord ]]:
285
287
"""Capture logs from IDOM
286
288
287
289
Parameters:
288
- use_existing :
290
+ yield_existing :
289
291
If already inside an existing capture context yield the same list of logs.
290
292
This is useful if you need to mutate the list of logs to affect behavior in
291
293
the outer context.
292
294
"""
293
- if use_existing :
295
+ if yield_existing :
294
296
for handler in reversed (ROOT_LOGGER .handlers ):
295
297
if isinstance (handler , _LogRecordCaptor ):
296
298
yield handler .records
You can’t perform that action at this time.
0 commit comments