homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scoder
Recipients scoder
Date 2012年03月02日.16:36:22
SpamBayes Score 7.0859023e-06
Marked as misclassified No
Message-id <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za>
In-reply-to
Content
These are tests from lxml's ET compatibility test suite that now fail in ElementTree:
 def test_delslice_step(self):
 Element = self.etree.Element
 SubElement = self.etree.SubElement
 a = Element('a')
 b = SubElement(a, 'b')
 c = SubElement(a, 'c')
 d = SubElement(a, 'd')
 e = SubElement(a, 'e')
 del a[1::2]
 self.assertEquals(
 [b, d],
 list(a))
 def test_delslice_step_negative(self):
 Element = self.etree.Element
 SubElement = self.etree.SubElement
 a = Element('a')
 b = SubElement(a, 'b')
 c = SubElement(a, 'c')
 d = SubElement(a, 'd')
 e = SubElement(a, 'e')
 del a[::-1]
 self.assertEquals(
 [],
 list(a))
 def test_delslice_step_negative2(self):
 Element = self.etree.Element
 SubElement = self.etree.SubElement
 a = Element('a')
 b = SubElement(a, 'b')
 c = SubElement(a, 'c')
 d = SubElement(a, 'd')
 e = SubElement(a, 'e')
 del a[::-2]
 self.assertEquals(
 [b, d],
 list(a))
The error messages go like this:
 del a[1::2]
 ValueError: attempt to assign sequence of size 0 to extended slice of size 2
 del a[::-1]
 ValueError: attempt to assign sequence of size 0 to extended slice of size 4
 del a[::-2]
 ValueError: attempt to assign sequence of size 0 to extended slice of size 2
Additionally, I get this error:
 self.assertNotEquals(None, e.code)
 AttributeError: 'ParseError' object has no attribute 'code'
for this test:
 required_versions_ET['test_feed_parser_error_position'] = (1,3)
 def test_feed_parser_error_position(self):
 ParseError = self.etree.ParseError
 parser = self.etree.XMLParser()
 try:
 parser.close()
 except ParseError:
 e = sys.exc_info()[1]
 self.assertNotEquals(None, e.code)
 self.assertNotEquals(0, e.code)
 self.assert_(isinstance(e.position, tuple))
 self.assert_(e.position >= (0, 0))
The complete test suite is here:
https://github.com/lxml/lxml/blob/master/src/lxml/tests/test_elementtree.py 
History
Date User Action Args
2012年03月02日 16:36:24scodersetrecipients: + scoder
2012年03月02日 16:36:23scodersetmessageid: <1330706183.38.0.536130831322.issue14178@psf.upfronthosting.co.za>
2012年03月02日 16:36:22scoderlinkissue14178 messages
2012年03月02日 16:36:22scodercreate

AltStyle によって変換されたページ (->オリジナル) /