generated_tests: Convert to python3

This uses python3 for generating tests. This was generated by the 2to3
tool, with a few hand tuned changes, mainly around print statements that
already used grouping parens.
CMakeLists: Change python 2 dependency to python 3