Andrew Bennetts <andrew-pythondev at puzzling.org> writes: > Ben Finney wrote: > > Andrew Bennetts <andrew-pythondev at puzzling.org> 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4