Convert run tests to python