Skip to content

Commit 7dd70b6

Browse files
committed
rename to avoid hook rook rule complaint
1 parent 760c479 commit 7dd70b6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: src/idom/testing.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def assert_idom_logged(
197197
error_pattern = re.compile(match_error)
198198

199199
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:
201201
yield None
202202
except Exception:
203203
raise
@@ -281,16 +281,18 @@ def _raise_log_message_error(
281281

282282

283283
@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]]:
285287
"""Capture logs from IDOM
286288
287289
Parameters:
288-
use_existing:
290+
yield_existing:
289291
If already inside an existing capture context yield the same list of logs.
290292
This is useful if you need to mutate the list of logs to affect behavior in
291293
the outer context.
292294
"""
293-
if use_existing:
295+
if yield_existing:
294296
for handler in reversed(ROOT_LOGGER.handlers):
295297
if isinstance(handler, _LogRecordCaptor):
296298
yield handler.records

0 commit comments

Comments
 (0)