Fix test case for Python 3