[Python-checkins] cpython: The C accelerator was not always imported for cElementTree's tests. (there's

florent.xicluna python-checkins at python.org
Thu Feb 16 23:18:15 CET 2012


http://hg.python.org/cpython/rev/44728ec9318f
changeset: 74990:44728ec9318f
user: Florent Xicluna <florent.xicluna at gmail.com>
date: Thu Feb 16 23:17:31 2012 +0100
summary:
 The C accelerator was not always imported for cElementTree's tests. (there's still an issue with --huntrleaks switch)
files:
 Lib/test/test_xml_etree.py | 1 -
 Lib/test/test_xml_etree_c.py | 5 ++++-
 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_xml_etree.py b/Lib/test/test_xml_etree.py
--- a/Lib/test/test_xml_etree.py
+++ b/Lib/test/test_xml_etree.py
@@ -1352,7 +1352,6 @@
 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
--- a/Lib/test/test_xml_etree_c.py
+++ b/Lib/test/test_xml_etree_c.py
@@ -5,7 +5,7 @@
 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 @@
 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
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

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