[Biopython-dev] test_Ace, test_Nexus, test_Phd

Peter biopython at maubp.freeserve.co.uk
Fri Feb 13 16:02:41 UTC 2009


On Tue, Feb 10, 2009 at 11:25 AM, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
>
>> The test_Nexus tearDown used to make sure the temp output
>> files were removed.  This is important on Windows which
>> does not do this automatically.  I see you now allocate
>> "random" filenames using tempfile.NamedTemporaryFile(...)
>> so presumably we would need to record these so that the
>> tearDown method knows what temp files to remove.
>
> From reading the Python documentation, the file created by
> tempfile.NamedTemporaryFile is removed automatically
> when the file handle is closed, even on Windows.

That's good to know.  On a related point, I've just found
test_Nexus.py is failing on Windows XP with Python 2.6 (but is fine
with Python 2.3, 2.4 and 2.5):

C:\repository\biopython\Tests>c:\python26\python test_Nexus.py
Test Nexus module ... ERROR
Test Tree module. ... ok

======================================================================
ERROR: Test Nexus module
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_Nexus.py", line 114, in test_NexusTest1
    f1=tempfile.NamedTemporaryFile(mode='r+w+b')
  File "c:\python26\lib\tempfile.py", line 445, in NamedTemporaryFile
    file = _os.fdopen(fd, mode, bufsize)
OSError: [Errno 22] Invalid argument

----------------------------------------------------------------------
Ran 2 tests in 0.016s

FAILED (errors=1)


I don't have time to look into this right now, but should be able to
investigate next week.

Peter




More information about the Biopython-dev mailing list