[Zope-dev] [PATCH] Better error support in subunit output formatter

Jonathan Lange jml at mumak.net
Sat Apr 10 13:20:27 EDT 2010


Hello,

The subunit output formatter that was added recently currently raises
NotImplementedError when it's given a generic "error". The error()
method on formatters is used to communicate user error (e.g. when the
user selects incompatible options), internal framework errors (afaict,
only when there's a subprocess read error) and layer setUp errors.

I find the idea of masking layer setUp errors to be unconscionably
awful, so I've attached the following patch, which changes the subunit
formatter's error() method to print out whatever it gets. It doesn't
have any tests, but it's simple enough, and none of the other
formatters have tests for this method either.

Ideally, I think there should be a new method on OutputFormatter to
handle layer setup failure. Probably teardown failure too. If someone
wants to push back on this simple patch in favour of a new method, I
could probably be persuaded to do the work, provided I had clear
backwards compatibility guidelines.

jml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: subunit-error.diff
Type: text/x-patch
Size: 648 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20100410/77b0d554/attachment.bin 


More information about the Zope-Dev mailing list