A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-January/011877.html below:

[Python-Dev] Re: test_support.py

[Python-Dev] Re: test_support.py [Python-Dev] Re: test_support.pyM.-A. Lemburg mal@lemburg.com
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?
> 
> [...grep...]
> 
> 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
>     instead.
> 
> Proposal:
> 
> (1) change verify() to raise TestFailed;
> 
> (2) change test_unicode.py to catch TestFailed instead.

+1

Why not simply make TestFailed a subclass of AssertionError ?
Then we wouldn't have to fear about breaking test code...

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/



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