py2/3 more print and exception compat for tests