>>> For a silly example, assume testing whether 1/0 and -1/0 both throw an >>> exception. Would you write >>> >>> with raises(DivisionByZero): >>> 1/0 >>> with raises(DivisionByZero): >>> -1/0 >>> >>> or >>> >>> with raises(DivisionByZero): >>> 1/0 >>> -1/0
In my mind I would treat the with block like a try block and understand that as soon as an error is raised the exception occurs...so I wouldn't write it with two statements to be tested (like above) because I would know that the first error would kick me out of the block. -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
