Python test 模块,test_xml_etree() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用test.test_xml_etree()

项目:zippy    作者:securesystemslab    | 项目源码 | 文件源码
def test_main(module_name='xml.etree.ElementTree'):
    from test import test_xml_etree

    use_py_module = (module_name == 'xml.etree.ElementTree')

    # The same doctests are used for both the Python and the C implementations
    assert test_xml_etree.ET.__name__ == module_name

    # XXX the C module should give the same warnings as the Python module
    with CleanContext(quiet=not use_py_module):
        support.run_doctest(test_xml_etree, verbosity=True)

    # The module should not be changed by the tests
    assert test_xml_etree.ET.__name__ == module_name
项目:oil    作者:oilshell    | 项目源码 | 文件源码
def test_main(module_name='xml.etree.ElementTree'):
    from test import test_xml_etree

    use_py_module = (module_name == 'xml.etree.ElementTree')

    # The same doctests are used for both the Python and the C implementations
    assert test_xml_etree.ET.__name__ == module_name

    # XXX the C module should give the same warnings as the Python module
    with CleanContext(quiet=not use_py_module):
        test_support.run_doctest(test_xml_etree, verbosity=True)

    # The module should not be changed by the tests
    assert test_xml_etree.ET.__name__ == module_name
项目:python2-tracer    作者:extremecoders-re    | 项目源码 | 文件源码
def test_main(module_name='xml.etree.ElementTree'):
    from test import test_xml_etree

    use_py_module = (module_name == 'xml.etree.ElementTree')

    # The same doctests are used for both the Python and the C implementations
    assert test_xml_etree.ET.__name__ == module_name

    # XXX the C module should give the same warnings as the Python module
    with CleanContext(quiet=not use_py_module):
        test_support.run_doctest(test_xml_etree, verbosity=True)

    # The module should not be changed by the tests
    assert test_xml_etree.ET.__name__ == module_name
项目:pefile.pypy    作者:cloudtracer    | 项目源码 | 文件源码
def test_main(module_name='xml.etree.ElementTree'):
    from test import test_xml_etree

    use_py_module = (module_name == 'xml.etree.ElementTree')

    # The same doctests are used for both the Python and the C implementations
    assert test_xml_etree.ET.__name__ == module_name

    # XXX the C module should give the same warnings as the Python module
    with CleanContext(quiet=not use_py_module):
        test_support.run_doctest(test_xml_etree, verbosity=True)

    # The module should not be changed by the tests
    assert test_xml_etree.ET.__name__ == module_name
项目:ndk-python    作者:gittor    | 项目源码 | 文件源码
def test_main(module_name='xml.etree.ElementTree'):
    from test import test_xml_etree

    use_py_module = (module_name == 'xml.etree.ElementTree')

    # The same doctests are used for both the Python and the C implementations
    assert test_xml_etree.ET.__name__ == module_name

    # XXX the C module should give the same warnings as the Python module
    with CleanContext(quiet=not use_py_module):
        test_support.run_doctest(test_xml_etree, verbosity=True)

    # The module should not be changed by the tests
    assert test_xml_etree.ET.__name__ == module_name