[Biopython-dev] test_PhyloXML.py failing on Windows

Peter biopython at maubp.freeserve.co.uk
Wed Feb 24 07:37:20 EST 2010


Hi Eric,

Do you have access to a Windows machine for testing? There
seem to be two issues in the PhyloXML tests (tested on
Python 2.5, 2.6 and 2.7a1 on Windows XP):

Count and confirm the number of tags in each example XML file. ... FAIL
Round-trip parsing and serialization of apaf.xml. ... ERROR
Round-trip parsing and serialization of bcl_2.xml. ... ERROR
Round-trip parsing and serialization of o_tol_332_d_dollo.xml. ... ERROR
Round-trip parsing and serialization of made_up.xml. ... ERROR
Round-trip parsing and serialization of phyloxml_examples.xml. ... ERROR

The tag count error I don't immediately understand:

======================================================================
FAIL: Count and confirm the number of tags in each example XML file.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\repositories\biopython_official\Tests\test_PhyloXML.py",
line 56, in test_dump_tags
    self.assertEquals(len(output.readlines()), count)
AssertionError: 301 != 289

----------------------------------------------------------------------

The rest all fail in _stash_rewrite_and_call where something about
your file renaming is failing. It looks like you deliberately move some
of your example XML files to a temp filename during the test and
then move them back. This seems risky (e.g. if the test suite is
stopped mid way). Can you rework this to write the output to a
temp file or perhaps better yet a StringIO handle?

The errors look like this:

======================================================================
ERROR: Round-trip parsing and serialization of apaf.xml.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_PhyloXML.py", line 561, in test_apaf
    (TreeTests, ['test_DomainArchitecture']),
  File "test_PhyloXML.py", line 546, in _stash_rewrite_and_call
    os.rename(fname, fname + '~')
WindowsError: [Error 183] Cannot create a file when that file already exists

----------------------------------------------------------------------

Thanks,

Peter


More information about the Biopython-dev mailing list