]> granicus.if.org Git - python/commitdiff
The C accelerator was not always imported for cElementTree's tests. (there's still...
authorFlorent Xicluna <florent.xicluna@gmail.com>
Thu, 16 Feb 2012 22:17:31 +0000 (23:17 +0100)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Thu, 16 Feb 2012 22:17:31 +0000 (23:17 +0100)
Lib/test/test_xml_etree.py
Lib/test/test_xml_etree_c.py

index 6060e06732d78e94009014ab7c368624718d1d0c..8713de5f59343bd47f50de7da7440e3390c52cf4 100644 (file)
@@ -1352,7 +1352,6 @@ def xinclude():
     r"""
     Basic inclusion example (XInclude C.1)
 
-    >>> from xml.etree import ElementTree as ET
     >>> from xml.etree import ElementInclude
 
     >>> document = xinclude_loader("C1.xml")
index dbe1c3aff147d3b948db8fe38b8c38051c8b5b70..a73d0c4b82bbbb167cd1f8b2cfdeb232946baae4 100644 (file)
@@ -5,7 +5,7 @@ from test.support import import_fresh_module
 import unittest
 
 cET = import_fresh_module('xml.etree.ElementTree', fresh=['_elementtree'])
-cET_alias = import_fresh_module('xml.etree.cElementTree', fresh=['_elementtree'])
+cET_alias = import_fresh_module('xml.etree.cElementTree', fresh=['_elementtree', 'xml.etree'])
 
 
 # cElementTree specific tests
@@ -52,6 +52,9 @@ class TestAcceleratorImported(unittest.TestCase):
     def test_correct_import_cET(self):
         self.assertEqual(cET.Element.__module__, '_elementtree')
 
+    def test_correct_import_cET_alias(self):
+        self.assertEqual(cET_alias.Element.__module__, '_elementtree')
+
 
 def test_main():
     from test import test_xml_etree, test_xml_etree_c