python tests: Make test compatible with Python 2.6