A better unittest

Thomas Heller theller at python.net
Thu Apr 17 12:20:18 EDT 2003


Duncan Booth <duncan at NOSPAMrcp.co.uk> writes:

> > The difference code could actually be made much faster quite easily.
> > If I added a search for the first difference, then I could do the
> > ellipsis and truncating first and only pass what is left to difflib.
> 
> Old version took 0.18 seconds on Python 2.3, gave up waiting on Python 2.2. 
> This version takes 0.18 on Python 2.2, 0.08 on Python 2.3.

Cool! I can now use 10 million character strings, and the test only
takes 1.5s in 2.2, and 0.7s in CVS python.

Thomas




More information about the Python-list mailing list