tests: Python3 compatibility. Proper asserts and failures.