still not happy with unittest.failUnlessRaises

paul koelle paul at subsignal.org
Sun Oct 10 11:49:00 CEST 2004


Tim Peters wrote:
> [paul koelle]
>>code:
>>print 'this is expected to fail. The "Type" column is unique in the DB'
> 
> 
> By "this is expected to fail", do you mean that the test is supposed
> to fail, or that the test is supposed to pass by verifying that the
> thing it's testing fails?  "This" is ambiguous.  I'll assume the
> latter.
correct.

[ snipp ]
> You didn't show enough code so that a reader could guess the answers
> to these questions.
My apologies. In fact, it turned out to be simple as:
self.failUnlessRaises(IntegrityError, certs.Subcacert.new, 
**self.client_tmpl)

thanks again
  Paul



More information about the Python-list mailing list