Fix tests check_output for py2.6