]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_xml_etree_c.py
1 # xml.etree test for cElementTree
3 from test
import test_support
4 from test
.test_support
import precisionbigmemtest
, _2G
7 cET
= test_support
.import_module('xml.etree.cElementTree')
10 # cElementTree specific tests
16 >>> from xml.etree import cElementTree
20 class MiscTests(unittest
.TestCase
):
22 @precisionbigmemtest(size
=_2G
+ 100, memuse
=1)
23 def test_length_overflow(self
, size
):
25 self
.skipTest("not enough free memory, need at least 2 GB")
27 parser
= cET
.XMLParser()
29 self
.assertRaises(OverflowError, parser
.feed
, data
)
35 from test
import test_xml_etree
, test_xml_etree_c
37 # Run the tests specific to the C implementation
38 test_support
.run_doctest(test_xml_etree_c
, verbosity
=True)
40 # Assign the C implementation before running the doctests
41 # Patch the __name__, to prevent confusion with the pure Python test
42 pyET
= test_xml_etree
.ET
43 py__name__
= test_xml_etree
.__name
__
44 test_xml_etree
.ET
= cET
45 if __name__
!= '__main__':
46 test_xml_etree
.__name
__ = __name__
48 # Run the same test suite as xml.etree.ElementTree
49 test_xml_etree
.test_main(module_name
='xml.etree.cElementTree')
51 test_xml_etree
.ET
= pyET
52 test_xml_etree
.__name
__ = py__name__
54 if __name__
== '__main__':