Switch to use contextlib.ExitStack for cleaner run context
Fix pylint error
Add WarnHandler to automatically capture warnings, and re-emits them at the end of the session. Recods now remember the originating test