Conditions | 1 |
Total Lines | 9 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import logging |
||
9 | @pytest.fixture |
||
10 | def caplog(_caplog): |
||
11 | class PropogateHandler(logging.Handler): |
||
12 | def emit(self, record): |
||
13 | logging.getLogger(record.name).handle(record) |
||
14 | |||
15 | handler_id = logger.add(PropogateHandler(), format="{message} {extra}") |
||
16 | yield _caplog |
||
17 | logger.remove(handler_id) |
||
18 | |||
21 |