Closed Starou closed 6 years ago
Fails on Travis (Ubuntu Trusty 14.04.05 LTS, Python 2.7.13) when the version of lxml is not set to 3.6:
======================================================================
ERROR: test_attributes (regressiontests.components.XMLElementTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/Starou/SimpleIDML/tests/regressiontests/components.py", line 428, in test_attributes
self.assertEqual(module_elt.get_attribute("foo"), None)
File "../src/simple_idml/components.py", line 904, in get_attribute
attr_node = self._get_attribute_node(name)
File "../src/simple_idml/components.py", line 909, in _get_attribute_node
attr_node = self.xpath("./XMLAttribute[@Name='%s']" % name)
File "src/lxml/etree.pyx", line 1586, in lxml.etree._Element.xpath (src/lxml/etree.c:61218)
TypeError: Argument 'element' has incorrect type (expected lxml.etree._Element, got XMLElement)
test_add_pages_from_idml_to_template
TypeError : Argument 'element' has incorrect type (expected lxml.etree._Element, got XMLElement)
Fixed in Python3 support branch
The recent work on porting the codebase to Python 3 shows that having the last version of
lxml
is not the reason for having the test suite to fails. The reason is the minor version of Python 2.7.Python 2.7.10 : OK Python 2.7.12 : 1 error :
Python 2.7.14: 2 errors.
So it is safe to relax the lxml version constraints.