test/py: Automated conversion to Python 3