Refactor test_logging to use unittest. This should finally solve the flakiness
issues.

Thanks to Antoine Pitrou for the patch.
3 files changed