Previous entry.

During the second day I refactored the Zope 3 test runner to make nearly all of its output go through a single OutputFormatter class (in the output-refactoring branch), then created a subclass of it that uses ANSI color codes to highlight error messages (in the colorized-output branch). I've had this luxury before, and I can attest that it does increase productivity (being able to spot filenames and line numbers between several-hundred-line diffs produced by testbrowser tests is invaluable).

Zope 3 test
    runner in a white terminal Zope 3 test
    runner in a black terminal

I also had lots of fun trying to get the unit test coverage of the test runner. There's a bit of a chicken and egg problem here: to get accurate coverage data you want the tracer to be enabled during import time, but you cannot do that since the test runner doesn't exist yet. Hacks with reload() and del sys.modules['zope.testing.testrunner'] didn't work due to excessive monkey-patching in the test runner that caused infinite recursion. In the end I made a second copy of the module and used it to run the test suite of the first copy. (42% of the code is not covered by unit tests, according to the coverage report. I don't entirely trust that report, though.)

On the last day I intend to clean up the code, add the unit tests for my colorizer, and merge it to trunk.

Continued...

Technorati tag: