Fix a Python 3 incompatibility in the unit tests.