Re: [Zope-dev] [PATCH] Better error support in subunit output formatter
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tres Seaver wrote: > Jonathan Lange wrote: >> On Sat, Apr 10, 2010 at 7:16 PM, Tres Seaver wrote: >>> -BEGIN PGP SIGNED MESSAGE- >>> Hash: SHA1 >>> >>> Jonathan Lange wrote: 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. >>> Your patches look pretty reasonable to me: can you kick them into >>> Launchpad so they don't get lost in the mailing list archives? There is >>> a project page for zope.app.testing, but it doesn't (as of today) have >>> the bug tracker turned on. >>> >>> https://launchpad.net/zope.app.testing >>> >> Branches pushed, merge proposals created, bugs filed, branches linked. > > Thank you! I have merged you changes for zope.app.testing and made a relaese: I also closed LP #560222. However, I haven't yet been able to pull your branch for the zope.testing subunit fix. Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkvBF6QACgkQ+gerLs4ltQ4K9gCgiA6ufSDRZEAMBBN3mQY4zFXQ uzsAnjM/7VwJvUUwg5M7dKxBbOJGMOv7 =7it9 -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] [PATCH] Better error support in subunit output formatter
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jonathan Lange wrote: > On Sat, Apr 10, 2010 at 7:16 PM, Tres Seaver wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Jonathan Lange wrote: >>> 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. >> Your patches look pretty reasonable to me: can you kick them into >> Launchpad so they don't get lost in the mailing list archives? There is >> a project page for zope.app.testing, but it doesn't (as of today) have >> the bug tracker turned on. >> >> https://launchpad.net/zope.app.testing >> > > Branches pushed, merge proposals created, bugs filed, branches linked. Thank you! > FWIW, I sent to the mailing list first because last time I tried this > I filed bugs, pushed up branches etc. and didn't get any response > until I posted patches to the ML :) We'll try to do better this time ;). Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkvBDkgACgkQ+gerLs4ltQ6UPQCfTbRslosIjKiAEPyecXpEvnLb 2G0AoNPLQ7Oegzo1yj0H0XGxIxt82lUB =wE53 -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] [PATCH] Better error support in subunit output formatter
On Sat, Apr 10, 2010 at 7:16 PM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Jonathan Lange wrote: >> 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. > > Your patches look pretty reasonable to me: can you kick them into > Launchpad so they don't get lost in the mailing list archives? There is > a project page for zope.app.testing, but it doesn't (as of today) have > the bug tracker turned on. > > https://launchpad.net/zope.app.testing > Branches pushed, merge proposals created, bugs filed, branches linked. FWIW, I sent to the mailing list first because last time I tried this I filed bugs, pushed up branches etc. and didn't get any response until I posted patches to the ML :) jml ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] [PATCH] Better error support in subunit output formatter
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Jonathan Lange wrote: > 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. Your patches look pretty reasonable to me: can you kick them into Launchpad so they don't get lost in the mailing list archives? There is a project page for zope.app.testing, but it doesn't (as of today) have the bug tracker turned on. https://launchpad.net/zope.app.testing For now, the Zope3 tracker is the right place for zope.app.* issues: https://bugs.launchpad.net/zope3 Tres. - -- === Tres Seaver +1 540-429-0999 tsea...@palladion.com Palladion Software "Excellence by Design"http://palladion.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkvAwH0ACgkQ+gerLs4ltQ57tACeP9VzumWF++MBaD6P6SohME9w e6MAn2MYPBF3LK5TfFKRjJkNGAQfjH+w =nYkx -END PGP SIGNATURE- ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] [PATCH] Better error support in subunit output formatter
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 === modified file 'src/zope/testing/testrunner/formatter.py' --- src/zope/testing/testrunner/formatter.py 2010-04-06 03:02:54 + +++ src/zope/testing/testrunner/formatter.py 2010-04-10 15:27:41 + @@ -795,8 +795,7 @@ """Report an error.""" # XXX: Mostly used for user errors, sometimes used for errors in the # test framework, sometimes used to record layer setUp failure (!!!). -# How should this be encoded? -raise NotImplementedError(self.error) +self._stream.write('%s\n' % (message,)) def error_with_banner(self, message): """Report an error with a big ASCII banner.""" ___ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )