The C accelerator was not always imported for cElementTree's tests. (there's still an issue with --huntrleaks switch)

This commit is contained in:
Florent Xicluna 2012-02-16 23:17:31 +01:00
parent 17f1be6368
commit e59a306081
2 changed files with 4 additions and 2 deletions

View 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