This is a fix for the problem seen here: eisensheng/pytest-catchlog#37
I would like to validate some logs globally for the entire test suite. The problem is that caplog gives you one bucket of logs for the phase you're currently in, but I want to check the 'call' bucket when I'm in 'teardown'. This change makes it possible to access all the buckets from all the other.
nicoddemus left a comment •
Looks good as a first iteration, thanks!
Some things missing:
Also I think we should mention this in the documentation, in
Thanks again @boxed!
@boxed good point! I propose we create a
def get_handler(self, when): """...""" return self._item.catch_log_handlers.get(when)
This way we don't expose the entire