Tests failing with Python 3.12 · Issue #34 · sphinx-contrib/restbuilder · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests failing with Python 3.12 #34

Open
tijuca opened this issue Jul 26, 2024 · 1 comment
Open

Tests failing with Python 3.12 #34

tijuca opened this issue Jul 26, 2024 · 1 comment

Comments

@tijuca
Copy link

tijuca commented Jul 26, 2024

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

@s3v-
Copy link

s3v- commented Nov 8, 2024

Hi,

Sphinx 7.3 changed the output from "New in version..." to "Added in version...". I guess the test simply needs to be adapted.
Please see: sphinx-doc/sphinx@db4939f

Kind Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants