Fix test for Python 3