March 2003
Intermediate to advanced
656 pages
39h 30m
English
assertRaises, failUnlessRaises
t.assertRaises(exceptionSpec,callable,*args)Calls
callable
(*
args
).
Fails if the call doesn’t raise any exception. If
the call raises an exception not meeting
exceptionSpec,
assertRaises propagates the exception. If the call
raises an exception meeting exceptionSpec,
assertRaises does nothing.
exceptionSpec can be an exception class or
a tuple of classes, just like the first argument to the
except clause of a
try/except statement.
failUnlessRaises is a synonym.
Read now
Unlock full access