From: Florent Xicluna Date: Thu, 16 Feb 2012 22:17:31 +0000 (+0100) Subject: The C accelerator was not always imported for cElementTree's tests. (there's still... X-Git-Tag: v3.3.0a1~161^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e59a306081d8f34814b91dc9e911beac7271c452;p=python The C accelerator was not always imported for cElementTree's tests. (there's still an issue with --huntrleaks switch) --- diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py index 6060e06732..8713de5f59 100644 --- a/Lib/test/test_xml_etree.py +++ b/Lib/test/test_xml_etree.py @@ -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") diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py index dbe1c3aff1..a73d0c4b82 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -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