On 27 September 2011 19:59, Laurens Van Houtven <_...@lvh.cc> wrote: > Sure, you just *do* it. The only advantage I see in assertNotRaises is that > when that exception is raised, you should (and would) get a failure, not an > error.
It's a useful distinction. I have found myself writing code of the form: def test_old_exception_no_longer_raised(self): try: do_something(): except OldException: self.assertTrue(False) in order to distinguish between a regression and something new erroring. The limitation of this pattern is that the test failure message is not as good. _______________________________________________ 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