Michael Foord wrote: > Raymond Hettinger wrote: [...] >> >> If some people want to proceed down the path of "useful additions", >> I challenge them to think bigger. Give me some test methods that >> improve my life. Don't give me thirty ways to spell something I can >> already do. >> > > I assert that... the following changes do meet those conditions: > > assertRaisesWithMessage - for testing the error messages from library > functions, where the error message is part of the API under test (I'm > less convinced with the need for a regex matching version myself.) This one is easily solved by making assertRaises return the exception it caught. e.g.: exc = self.assertRaises(AttributeError, getattr, foo, 'bar') self.assertEqual("'Foo' object has no attribute 'bar'", exc.message) At least Twisted and bzr have already made this exact change. It requires no new methods, and is more flexible than the proposed assertRaisesWithMessage. -Andrew.
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