piranha/opster — pull request #21 by oscarbenjamin (2012-04-20 18:29:14+00:00)
Title: Py3k tests running and passing

After the discussion at 39226c9 I wondered how well opster does work in python3. I use it in python3 but I don't use all of its functionality so I wasn't sure.

These 3 commits add a 'make test2to3' command to test under python3 and fix all the tests to work with python3.

The first commit ff3a1068baede4e modifies all the python test files to run under both python 2.6+ and python 3.x using the 2to3 fixer.

The second commit 4032559b7ba adds a command 'make test2to3' that will build the python3 version of opster and run the tests on it. This assumes that an executable called python3 is somewhere on PATH and that the python3 interpreter has the newest cram installed (with --shell parameter).

After those two commits two of the tests fail under python3 due to encoding errors. The third commit 0b4ab3495b52 attempts to fix this. I don't really know a lot about file encodings so I'm not confident about how well this approach works. It does, however, result in all tests passing under python 2.6 and python 3.1 (on Windows).

Thanks,
Oscar.