On Tue, Aug 16, 2011 at 10:19 PM, Gary Poster <gary.pos...@canonical.com> wrote: > > On Aug 16, 2011, at 11:13 AM, Jonathan Lange wrote: > >> On Tue, Aug 16, 2011 at 3:46 PM, Jeroen Vermeulen <j...@canonical.com> wrote: >>> Since my last thread of this kind led to such great news, I'm just going to >>> keep doing it. >>> >>> Wouldn't it be great if our test suite automatically ran each of our utility >>> interfaces through: >>> >>> self.assertProvides( >>> getUtility(ISomethingSource), ISomethingSource) >>> >>> It's a pain to have to remember doing that for every utility, but doing it >>> quickly checks for a wide range of possible mistakes. >>> >> >> You don't have to remember if you are doing TDD and it's testing a >> behaviour worth having. >> >> That said, ZCA probably ought to do a check like that on registration. > > And slow the startup further? I'd vote no. This is something that > historically has belonged in tests, and I think it should stay there.
If you know the internals, it would probably a 5 line test to check that every registered utility provides its interface. And a few extra lines to fix the test fallout... :-) -- Stuart Bishop <stu...@stuartbishop.net> http://www.stuartbishop.net/ _______________________________________________ Mailing list: https://launchpad.net/~launchpad-dev Post to : launchpad-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~launchpad-dev More help : https://help.launchpad.net/ListHelp