[test] Refactoring

* make unittests python3 and python2 compatible
* refactor logging mocks to the top level of the class
* skip Riemann related tests if bernhard is not present