fix Python 3 incompatibility in test runner