
Aug. 24, 2008
12:43 p.m.
Hi, It happens that I'm just interested in whether an expression raises an exception, not the return value. This might look something like try: check_status() except IOError: cleanup() which could be written more simply as if check_status() raises IOError: cleanup() Also, instead of the inconvenient self.assertRaises(ZeroDivisionError, lambda: 1/0) one could just write assert 1/0 raises ZeroDivisionError Something like this would especially be useful for those of us who aren't fans of the unittest framework. Alternatively, just the assert--raises form could be permitted. Thoughts? Fredrik