[Twisted-Python] Thoughts about testing
Jonathan Lange
jml at mumak.net
Thu Oct 27 00:15:57 MDT 2005
On 27/10/05, glyph at divmod.com <glyph at divmod.com> wrote:
>
>
> On Thu, 27 Oct 2005 11:38:01 +1100, Jonathan Lange <jml at mumak.net> wrote:
> >On 26/10/05, David Ripton <dripton at ripton.net> wrote:
>
> >> 1. assert, not self.failUnlessAllThisUglyCamelCaseActuallyKillsMe()
>
> >class FooTest(unittest.TestCase):
> > failureException = AssertionError
> >
> > def test_foo(self):
> > assert False #yay fails
>
> My understanding is that if you do
>
> t = True
> nil = False
> assert t == nil
>
> in py.test, the error reporting will show you "t != nil (True != False)" or somesuch, along with a bunch of other useful diagnostic information.
>
> My proposal was to steal this by doing 'self.failUnless(t == nil)' and stealing as much of their stack introspection junk (available as a hacked version of AssertionError) as we can.
Wicked. Please file a feature bug against me, topic 'trial'.
cheers,
jml
More information about the Twisted-Python
mailing list