Andrew Bennetts <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > Andrew Bennetts <[EMAIL PROTECTED]> writes: > > > > > This one is easily solved by making assertRaises return the > > > exception it caught. > > > > That breaks one simple feature of the unittest API: that all the > > test methods will either raise a failure asertion, or return None. > > How is returning None a feature?
A test method having exactly one meaning is a feature. If it's consistent across the API, the API retains a level of simplicity. > I've never seen code that somehow depends on assertRaises returning > None. I hope never to see code depending on methods named "assert*" returning something, instead of *only* asserting a condition. > Further, I have lots of evidence that in practice returning the > exception instance from assertRaises is not a problem, and is in > fact quite useful. I'm sure it's useful. I don't think it belongs in the return value of such a method. > I'd quote “Practicality beats purity”, but I'm not even sure if it > is purity that you have in mind. Close: I'm interested in keeping camel's noses out of tents. -- \ “Laugh and the world laughs with you; snore and you sleep | `\ alone.” —anonymous | _o__) | Ben Finney _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com