fix tests in Py2.5 and Py3