aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2012-06-15 09:03:19 +0300
committerEli Bendersky <eliben@gmail.com>2012-06-15 09:03:19 +0300
commit27cbb19ae562f258e64120c8ed17616719e32722 (patch)
treeeb86cb9bb67e87f5134dbf0ed728cdd288ea013f /Lib/test/test_xml_etree.py
parentmark problematic test as expected failure - investigating (diff)
downloadcpython-27cbb19ae562f258e64120c8ed17616719e32722.tar.gz
cpython-27cbb19ae562f258e64120c8ed17616719e32722.tar.bz2
cpython-27cbb19ae562f258e64120c8ed17616719e32722.zip
Removed _SimpleElementPath and its flaky test. The test monkey-patches the module, which causes other failures and fails itself depending on the order tests are run.
Diffstat (limited to 'Lib/test/test_xml_etree.py')
-rw-r--r--Lib/test/test_xml_etree.py23
1 files changed, 0 insertions, 23 deletions
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
index 22a1773e89e..87398b48620 100644
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -2234,28 +2234,6 @@ class NoAcceleratorTest(unittest.TestCase):
self.assertEqual(pyET.Element.__module__, 'xml.etree.ElementTree')
self.assertEqual(pyET.SubElement.__module__, 'xml.etree.ElementTree')
-
-class ElementPathFallbackTest(unittest.TestCase):
- def test_fallback(self):
- current_ElementPath = ET.ElementPath
- ET.ElementPath = ET._SimpleElementPath()
- elem = ET.XML(SAMPLE_XML)
- self.assertEqual(elem.find('tag').tag, 'tag')
- self.assertEqual(ET.ElementTree(elem).find('tag').tag, 'tag')
- self.assertEqual(elem.findtext('tag'), 'text')
- self.assertIsNone(elem.findtext('tog'))
- self.assertEqual(elem.findtext('tog', 'default'), 'default')
- self.assertEqual(ET.ElementTree(elem).findtext('tag'), 'text')
- self.assertEqual(summarize_list(elem.findall('tag')), ['tag', 'tag'])
- self.assertEqual(summarize_list(elem.findall('.//tag')),
- ['tag', 'tag', 'tag'])
-
- #self.assertIsNone(elem.find('section/tag'))
- #self.assertIsNone(elem.findtext('section/tag'))
- self.assertEqual(summarize_list(elem.findall('section/tag')), [])
-
- ET.ElementPath = current_ElementPath
-
# --------------------------------------------------------------------
@@ -2328,7 +2306,6 @@ def test_main(module=None):
if pyET:
test_classes.extend([
NoAcceleratorTest,
- ElementPathFallbackTest,
])
support.run_unittest(*test_classes)