If you are trying to verify that the code will work in Python 3.x, I would suggest a script that copies the source files to a new directory, runs 2to3 on them, and then copies the unit tests on and runs them.
This may seem a little inelegant, but consistent with the spirit of unit testing. You make a number of statements that, in your opinion, should be true regarding the external behavior of the code, regardless of its implementation. If the converted code passes your unit tests, you can consider your code to support Python 3.
source share