On Tue, 2011-03-08 at 19:52 +0800, Senthil Kumaran wrote:
> On Tue, Mar 8, 2011 at 7:43 PM, Kenneth Gonsalves
> wrote:
> >self.assertRaises(TypeError,testfunc())
>
> Not to call testfunc, but just exercise.
>
>self.assertRaises(TypeError,testfunc)
>
> unittest framework takes ca
On Tue, Mar 08 2011, Kenneth Gonsalves wrote:
> 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
On Tue, Mar 8, 2011 at 7:43 PM, Kenneth Gonsalves wrote:
> self.assertRaises(TypeError,testfunc())
Not to call testfunc, but just exercise.
self.assertRaises(TypeError,testfunc)
unittest framework takes care of calling and evaluating.
--
Senthil
_
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):