[Biopython-dev] test_PhyloXML.py on Python 3
Eric Talevich
eric.talevich at gmail.com
Tue Aug 17 01:59:27 UTC 2010
On Fri, Aug 13, 2010 at 6:29 AM, Peter <biopython at maubp.freeserve.co.uk>wrote:
>
> Yep - much better. However, I'm still seeing four failures with Python
> 3.1.2
> which appear to be related to float/int/long conversion:
>
>
> ERROR: test_made (__main__.WriterTests)
> Round-trip parsing and serialization of made_up.xml.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "test_PhyloXML.py", line 550, in test_made
> (TreeTests, ['test_Confidence', 'test_Polygon']),
[...]
> File "/home/xxx/lib/python3.1/site-packages/Bio/Phylo/PhyloXMLIO.py",
> line 589, in point
> _get_child_text(elem, 'long', float),
> File "/home/xxx/lib/python3.1/site-packages/Bio/Phylo/PhyloXMLIO.py",
> line 187, in _get_child_text
> return construct(child.text)
> ValueError: could not convert string to float: <class 'int'>
>
> ======================================================================
> ERROR: test_phylo (__main__.WriterTests)
> Round-trip parsing and serialization of phyloxml_examples.xml.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "test_PhyloXML.py", line 571, in test_phylo
> 'test_Taxonomy', 'test_Uri',
>
[...]
> ValueError: could not convert string to float: <class 'int'>
>
> ======================================================================
> FAIL: test_Distribution (__main__.TreeTests)
> Instantiation of Distribution objects.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "test_PhyloXML.py", line 322, in test_Distribution
> self.assertEqual(point.long, longi)
> AssertionError: <class 'int'> != 8.769303
>
> ======================================================================
> FAIL: test_Polygon (__main__.TreeTests)
> Instantiation of Polygon objects.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "test_PhyloXML.py", line 378, in test_Polygon
> self.assertEqual(point.long, longi)
> AssertionError: <class 'int'> != 8.769303
>
> ----------------------------------------------------------------------
>
I can't seem to replicate these errors. Are they still occurring on your
auto2to3 branch?
>From a clean master branch, I did:
git checkout -b three
2to3 -w -x long Bio/
2to3 -w BioSQL/ Tests/ setup.py
python3 setup.py build
sudo python3 setup.py install
cd Tests/
python3 test_Phylo.py
python3 test_PhyloXML.py
I'm using the 2to3 packaged with Python 2.7 from python.org, testing with
the Python 3.1.2 packaged for Ubuntu 10.04.
Any ideas?
Thanks,
Eric
More information about the Biopython-dev
mailing list