All:
Hi. I am an experienced developer (15 yrs), but new to Python and have
a question re unittest and assertRaises. No matter what I raise,
assertRaises is never successful. Here is the test code:
class Foo:
def testException(s elf):
raise ValueError
class FooTestCase(uni ttest.TestCase) :
testTryThis(sel f):
f = Foo()
self.assertRais es(ValueError, f.testException ())
This fails --- unittest reports the following:
FAILED (errors=1)
This seems like the most basic thing in the world. I am running Python
2.5 on Windows XP using Eclipse and PyDev
Any help appreciated.
Thanks,
John
Hi. I am an experienced developer (15 yrs), but new to Python and have
a question re unittest and assertRaises. No matter what I raise,
assertRaises is never successful. Here is the test code:
class Foo:
def testException(s elf):
raise ValueError
class FooTestCase(uni ttest.TestCase) :
testTryThis(sel f):
f = Foo()
self.assertRais es(ValueError, f.testException ())
This fails --- unittest reports the following:
FAILED (errors=1)
This seems like the most basic thing in the world. I am running Python
2.5 on Windows XP using Eclipse and PyDev
Any help appreciated.
Thanks,
John
Comment