fix tests on py2.6 and py3.2