tests: Fix issues with Python 2.6.