Make unit tests more compatible with Python 2.6