[Biopython-dev] [Bug 3016] New: Change WriterTests in test_PhyloXML.py to use StringIO or temp files

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Sat Feb 27 18:24:03 UTC 2010


http://bugzilla.open-bio.org/show_bug.cgi?id=3016

           Summary: Change WriterTests in test_PhyloXML.py to use StringIO
                    or temp files
           Product: Biopython
           Version: Not Applicable
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Unit Tests
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: eric.talevich at gmail.com


The method _stash_rewrite_and_call currently parses each of the example
phyloXML files, renames the parsed file to [filename]~, writes out another copy
(from the parsed data structure) using the original filename, re-runs the suite
of parser tests on the rewritten files, and finally renames the stashed copies
back to the original filenames. This is protected by a try-finally clause, but
could still fail to restore the original test files if the Python interpreter
is interrupted/killed. Moreover, the design is a little pathological, and could
be hard to maintain or extend later.

Redesign the writer tests to rewrite and test a copy of each originals at some
location other than the original filename. Ideally, use StringIO to store the
copy; a named temporary file (see tempfile module) is also acceptable.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list