2006-07-29 13:56:15 -03:00
|
|
|
# xml.etree test for cElementTree
|
2005-12-15 14:41:22 -04:00
|
|
|
|
|
|
|
from test import test_support
|
|
|
|
|
2010-03-11 10:36:19 -04:00
|
|
|
cET = test_support.import_module('xml.etree.cElementTree')
|
2005-12-16 18:07:17 -04:00
|
|
|
|
2005-12-15 14:41:22 -04:00
|
|
|
|
2010-03-11 10:36:19 -04:00
|
|
|
# cElementTree specific tests
|
2005-12-15 14:41:22 -04:00
|
|
|
|
|
|
|
def sanity():
|
|
|
|
"""
|
|
|
|
Import sanity.
|
|
|
|
|
2006-07-29 13:56:15 -03:00
|
|
|
>>> from xml.etree import cElementTree
|
2005-12-15 14:41:22 -04:00
|
|
|
"""
|
|
|
|
|
2006-08-16 13:47:07 -03:00
|
|
|
|
2005-12-15 14:41:22 -04:00
|
|
|
def test_main():
|
2010-03-11 10:36:19 -04:00
|
|
|
from test import test_xml_etree, test_xml_etree_c
|
|
|
|
|
|
|
|
# Run the tests specific to the C implementation
|
2005-12-15 14:41:22 -04:00
|
|
|
test_support.run_doctest(test_xml_etree_c, verbosity=True)
|
|
|
|
|
2010-03-11 10:36:19 -04:00
|
|
|
# Assign the C implementation before running the doctests
|
|
|
|
pyET = test_xml_etree.ET
|
|
|
|
test_xml_etree.ET = cET
|
|
|
|
try:
|
|
|
|
# Run the same test suite as xml.etree.ElementTree
|
|
|
|
test_xml_etree.test_main(module_name='xml.etree.cElementTree')
|
|
|
|
finally:
|
|
|
|
test_xml_etree.ET = pyET
|
|
|
|
|
2005-12-15 14:41:22 -04:00
|
|
|
if __name__ == '__main__':
|
|
|
|
test_main()
|