[Biopython-dev] Upcoming release

Brad Chapman chapmanb at arches.uga.edu
Fri Mar 2 16:39:00 EST 2001


Hi Jeff!

[PyUnit based regression test]
> - it should respect command line arguments and run only the tests
> specified.  For example, If I do "python pyunit_test.py test_translate,"
> it should only run the test_translate test.

Good idea! I missed this feature of br_regrtest.py. I added this. It
won't work with the GUI (ie. if you want a nice GUI, you have to run
all of the tests), but otherwise it seems to work.

> - in compare_output:
>         # normalize the newlines in the two lines
>         expected_line = string.strip(expected_line)
>         output_line = string.strip(output_line)
> 
> It looks like this is stripping the whitespace from the lines before
> they're being compared.  This may cause problems, because it won't catch
> whitespace related errors, such as formatting.  Instead, it should convert
> the ending newlines into some canonical form, e.g. '\n'.

Okay, I did this, although I don't know if I totally agree. In my
opinion it should be

string.rstrip(expected_line)

(I shoulda used rstrip in the first place!). The reason I am for this
is that I really think we don't have to be that picky about the
whitespace at the end of the line. A case in point is that changing
this led test_prodoc to fail with:

	Output  : 'J.\n'
	Expected: 'J. \n'

This just doesn't seem like a good reason to fail. But right now you
get your way, I'm just arguing my point :-)
 
> Are you going to have a chance to fix these *real soon*?  If so, then
> perhaps we can squeeze it into this release.

Okay, is this real soon enough for ya? :-). Instead of sending that
whole darn thing again, I just checked it into CVS. I checked in the
file as Tests/run_tests.py, and also included the necessary stuff from
PyUnit. Let me know if you don't like the names or anything and we can 
change 'em. I just thought this way might give some other people a
chance to CVS update and make sure this testing mechanism works for
them <hint, hint>.

I also made a small change to setup.py, so now you can run:

python setup.py test

and run the tests. This means when installing you can do:

python setup.py build
python setup.py install
python setup.py test

just like perl :-). The fun never stops with distutils!

Brad





More information about the Biopython-dev mailing list