hi, I am trying to figure out unittests on exceptions. I have a test which should pass - but it is failing. The simplest possible code is here:
#!/usr/bin/env python import unittest def testfunc(): if 1: raise TypeError class Testfunc(unittest.TestCase): def testit(self): self.assertRaises(TypeError,testfunc()) if __name__ == '__main__': unittest.main() -- regards Kenneth Gonsalves http://lawgon.livejournal.com/ _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers