Skip to content

Tests failing with Python 3.12 #34

@tijuca

Description

@tijuca

In Debian after migration to Python 3.12 the test suite is failing now.

dh_auto_test -O--buildsystem=pybuild
I: pybuild base:311: cd /build/sphinxcontrib-restbuilder-0.3/.pybuild/cpython3_3.12/build; python3.12 -m pytest tests
====================================================== test session starts ======================================================
platform linux -- Python 3.12.4, pytest-8.2.2, pluggy-1.5.0
rootdir: /build/sphinxcontrib-restbuilder-0.3
configfile: tox.ini
collected 37 items                                                                                                              

tests/test_rst_blocks.py ...                                                                                              [  8%]
tests/test_rst_code_blocks.py ......                                                                                      [ 24%]
tests/test_rst_formatting.py ......                                                                                       [ 40%]
tests/test_rst_headings.py .                                                                                              [ 43%]
tests/test_rst_hyperlinks.py .......                                                                                      [ 62%]
tests/test_rst_list.py ....ss.                                                                                            [ 81%]
tests/test_rst_table.py ...                                                                                               [ 89%]
tests/test_rst_toctree.py .                                                                                               [ 91%]
tests/test_sphinx_versionmodified.py F..                                                                                  [100%]

=========================================================== FAILURES ============================================================
_______________________________________________________ test_versionadded _______________________________________________________

src_dir = '/build/sphinxcontrib-restbuilder-0.3/.pybuild/cpython3_3.12/build/tests/datasets'
expected_dir = '/build/sphinxcontrib-restbuilder-0.3/.pybuild/cpython3_3.12/build/tests/expected'
output_dir = '/build/sphinxcontrib-restbuilder-0.3/.pybuild/cpython3_3.12/build/output'

    def test_versionadded(src_dir, expected_dir, output_dir):
>       run_parse_test(src_dir, expected_dir, output_dir, 'sphinx-directives', ['versionadded'])

tests/test_sphinx_versionmodified.py:5: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/utils.py:124: in run_parse_test
    assert_doc_equal(output_doc, expected_doc)
tests/utils.py:95: in assert_doc_equal
    assert_node_equal(output, expected)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

output = <#text: 'Added in version 0.3.1.'>, expected = <#text: 'New in version 0.3.1.'>

    def assert_node_equal(output, expected):
        assert type(output) == type(expected)
        if isinstance(output, Text):
            output_text = output.replace('\r\n', ' ')
            output_text = output_text.replace('\n', ' ')
            expected_text = expected.replace('\r\n', ' ')
            expected_text = expected_text.replace('\n', ' ')
>           assert output_text == expected_text
E           AssertionError

tests/utils.py:76: AssertionError
----------------------------------------------------- Captured stdout call ------------------------------------------------------

Seems the package needs a update as some internals in Python did have changed?

The full build log with the error is visible here
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076927

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