[Python-Dev] Re: test_support.py
Fri, 19 Jan 2001 17:34:58 +0100
Guido van Rossum wrote:
> > if not condition:
> > ! raise AssertionError(reason)
> Wouldn't it be better if this raised TestFailed rather than
> AssertionError? Or is there code that catches the AssertionError?
> Yes, there's code that catches AssertionError:
> (1) in Marc-Andre's own test_unicode.py;
> (2) in test_re, which catches AssertionError and raises TestFailed
> (1) change verify() to raise TestFailed;
> (2) change test_unicode.py to catch TestFailed instead.
Why not simply make TestFailed a subclass of AssertionError ?
Then we wouldn't have to fear about breaking test code...
Python Pages: http://www.lemburg.com/python/