Skip to content

Test failures #1036

Open
Open
@dbermond

Description

@dbermond

The following tests are failing to pass in version 5.0.0a5:

tests/test_examples.py::test_example[group] FAILED
tests/test_examples.py::test_example[headings] FAILED

Detailed failures output:

=================================== FAILURES ===================================
_____________________________ test_example[group] ______________________________

make_app = <function make_app.<locals>.make at 0x7fe476216de0>
tmp_path = PosixPath('/tmp/pytest-of-builduser/pytest-0/test_example_group_0')
test_input = PosixPath('/build/python-breathe/src/breathe-5.0.0a5/tests/data/examples/test_group')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fe475d86780>
doxygen = DoxygenExe(file='/usr/bin/doxygen', version=(1, 14, 0), template='PROJECT_NAME     = "example"\nHAVE_DOT         = YES...= "rst=\\verbatim embed:rst"\nALIASES += "endrst=\\endverbatim"\nALIASES += "inlinerst=\\verbatim embed:rst:inline"\n')
doxygen_cache = None

    @pytest.mark.parametrize("test_input", get_individual_tests(), ids=(lambda x: x.name[5:]))
    def test_example(make_app, tmp_path, test_input, monkeypatch, doxygen, doxygen_cache):
        monkeypatch.chdir(test_input)
    
        run_doxygen_with_template(doxygen, tmp_path, doxygen_cache, test_input.name, "xml")
        shutil.copyfile(test_input / "input.rst", tmp_path / "index.rst")
>       run_sphinx_and_compare(
            make_app,
            tmp_path,
            test_input,
            {"breathe_projects": {"example": str(tmp_path / "xml")}},
            doxygen.version,
        )

/build/python-breathe/src/breathe-5.0.0a5/tests/test_examples.py:317: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/build/python-breathe/src/breathe-5.0.0a5/tests/test_examples.py:308: in run_sphinx_and_compare
    compare_xml(tmp_path / "_build" / "xml" / "index.xml", test_input, version)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

generated = PosixPath('/tmp/pytest-of-builduser/pytest-0/test_example_group_0/_build/xml/index.xml')
input_dir = PosixPath('/build/python-breathe/src/breathe-5.0.0a5/tests/data/examples/test_group')
version = (1, 14, 0)

    def compare_xml(generated, input_dir, version):
        alt_models = list(map(versioned_model, input_dir.glob("compare-*.xml")))
        alt_models.sort(key=(lambda f: f.version), reverse=True)
    
        model = input_dir / "compare.xml"
        for alt_m in alt_models:
            if version >= alt_m.version:
                model = alt_m.file
                break
    
        event_str = {
            XMLEventType.E_START: "element start",
            XMLEventType.E_END: "element end",
            XMLEventType.E_TEXT: "text",
        }
    
        with open(generated, encoding="utf-8") as o_file, open(model, encoding="utf-8") as c_file:
            for o, c in zip(filtered_xml(o_file), filtered_xml(c_file)):
                o_type, o_node = o
                c_type, c_node = c
                assert o_type == c_type, (
                    f"at line {o_node.line_no}: found {event_str[o_type]} when expecting {event_str[c_type]}"  # noqa: E501
                )
    
                if o_type == XMLEventType.E_START:
                    assert o_node.name == c_node.name, (
                        f"wrong tag at line {o_node.line_no}: expected {c_node.name}, found {o_node.name}"  # noqa: E501
                    )
    
                    # ignore extra attributes in o_node
                    for key, value in c_node.attr.items():
                        if (
                            c_node.name == "desc_inline"
                            and key == "domain"
                            and sphinx.version_info[0] < 6
                        ):
                            # prior to Sphinx 6, this attribute was not present
                            continue
    
                        assert key in o_node.attr, f"missing attribute at line {o_node.line_no}: {key}"
                        o_value = o_node.attr[key]
                        assert attr_compare(key, o_value, value), (
                            f'wrong value for attribute "{key}" at line {o_node.line_no}: expected "{value}", found "{o_value}"'  # noqa: E501
                        )
                elif o_type == XMLEventType.E_TEXT:
>                   assert o_node.value == c_node.value, (
                        f'wrong content at line {o_node.line_no}: expected "{c_node.value}", found "{o_node.value}"'  # noqa: E501
                    )
E                   AssertionError: wrong content at line 6: expected "mygroup", found "My Group"
E                   assert 'My Group' == 'mygroup'
E                     
E                     - mygroup
E                     + My Group

/build/python-breathe/src/breathe-5.0.0a5/tests/test_examples.py:237: AssertionError
____________________________ test_example[headings] ____________________________

make_app = <function make_app.<locals>.make at 0x7fe47616bec0>
tmp_path = PosixPath('/tmp/pytest-of-builduser/pytest-0/test_example_headings_0')
test_input = PosixPath('/build/python-breathe/src/breathe-5.0.0a5/tests/data/examples/test_headings')
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fe47610f4a0>
doxygen = DoxygenExe(file='/usr/bin/doxygen', version=(1, 14, 0), template='PROJECT_NAME     = "example"\nHAVE_DOT         = YES...= "rst=\\verbatim embed:rst"\nALIASES += "endrst=\\endverbatim"\nALIASES += "inlinerst=\\verbatim embed:rst:inline"\n')
doxygen_cache = None

    @pytest.mark.parametrize("test_input", get_individual_tests(), ids=(lambda x: x.name[5:]))
    def test_example(make_app, tmp_path, test_input, monkeypatch, doxygen, doxygen_cache):
        monkeypatch.chdir(test_input)
    
        run_doxygen_with_template(doxygen, tmp_path, doxygen_cache, test_input.name, "xml")
        shutil.copyfile(test_input / "input.rst", tmp_path / "index.rst")
>       run_sphinx_and_compare(
            make_app,
            tmp_path,
            test_input,
            {"breathe_projects": {"example": str(tmp_path / "xml")}},
            doxygen.version,
        )

/build/python-breathe/src/breathe-5.0.0a5/tests/test_examples.py:317: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/build/python-breathe/src/breathe-5.0.0a5/tests/test_examples.py:308: in run_sphinx_and_compare
    compare_xml(tmp_path / "_build" / "xml" / "index.xml", test_input, version)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

generated = PosixPath('/tmp/pytest-of-builduser/pytest-0/test_example_headings_0/_build/xml/index.xml')
input_dir = PosixPath('/build/python-breathe/src/breathe-5.0.0a5/tests/data/examples/test_headings')
version = (1, 14, 0)

    def compare_xml(generated, input_dir, version):
        alt_models = list(map(versioned_model, input_dir.glob("compare-*.xml")))
        alt_models.sort(key=(lambda f: f.version), reverse=True)
    
        model = input_dir / "compare.xml"
        for alt_m in alt_models:
            if version >= alt_m.version:
                model = alt_m.file
                break
    
        event_str = {
            XMLEventType.E_START: "element start",
            XMLEventType.E_END: "element end",
            XMLEventType.E_TEXT: "text",
        }
    
        with open(generated, encoding="utf-8") as o_file, open(model, encoding="utf-8") as c_file:
            for o, c in zip(filtered_xml(o_file), filtered_xml(c_file)):
                o_type, o_node = o
                c_type, c_node = c
                assert o_type == c_type, (
                    f"at line {o_node.line_no}: found {event_str[o_type]} when expecting {event_str[c_type]}"  # noqa: E501
                )
    
                if o_type == XMLEventType.E_START:
>                   assert o_node.name == c_node.name, (
                        f"wrong tag at line {o_node.line_no}: expected {c_node.name}, found {o_node.name}"  # noqa: E501
                    )
E                   AssertionError: wrong tag at line 15: expected emphasis, found section
E                   assert 'section' == 'emphasis'
E                     
E                     - emphasis
E                     + section

/build/python-breathe/src/breathe-5.0.0a5/tests/test_examples.py:217: AssertionError
=========================== short test summary info ============================
FAILED tests/test_examples.py::test_example[group] - AssertionError: wrong content at line 6: expected "mygroup", found "My Group"
assert 'My Group' == 'mygroup'
  
  - mygroup
  + My Group
FAILED tests/test_examples.py::test_example[headings] - AssertionError: wrong tag at line 15: expected emphasis, found section
assert 'section' == 'emphasis'
  
  - emphasis
  + section
========================= 2 failed, 82 passed in 2.97s =========================

Commands used:

$ make parser
$ make format-parser
$ python -m build --wheel --no-isolation
$ python -m pytest -vv

System Information:

  • OS: Arch Linux
  • Doxygen: 1.14.0
  • Python: 3.13.5
  • python-setuptools: 80.9.0
  • python-sphinx: 8.2.3
  • python-pytest: 8.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions