unittest issues

paul koelle paul at subsignal.org
Mon Sep 13 00:35:14 CEST 2004


Hi,

I try to use the "failUnlessRaises()" method from unittest.TestCase as 
follows:

 >>self.failUnlessRaises(IntegrityError, myObject.new(**stuff))

where IntegrityError is an Exception somewhere deep inside pysqlite. 
Running it spits out:

 >>NameError: global name 'IntegrityError' is not defined.

Do I really need to tell unittest  about each and every possible 
Exception it might catch. Whats going on here?

python 2.2.3 on linux 2.6.7

thanks
  Paul



More information about the Python-list mailing list