Python 3 compatibility fix in tests.