Skip to content

Test failure on 32bit platforms: test_sphinx_directives[35-highlight (sphinx.directives.code.Highlight):] #522

@stefanor

Description

@stefanor

Describe the bug

context
As discovered in Debian unstable: https://bugs.debian.org/1005691

When running the test suite on a 32-bit platform, test_sphinx_directives[35-highlight (sphinx.directives.code.Highlight):] fails.

=================================== FAILURES ===================================
__ test_sphinx_directives[35-highlight (`sphinx.directives.code.Highlight`):] __

line = 35, title = 'highlight (`sphinx.directives.code.Highlight`):'
input = '```{highlight} something\n```\n'
expected = '<document source="notset">\n    <highlightlang force="False" lang="something" linenothreshold="9223372036854775807">\n'

    @pytest.mark.parametrize(
        "line,title,input,expected",
        read_fixture_file(FIXTURE_PATH.joinpath("sphinx_directives.md")),
        ids=[
            f"{i[0]}-{i[1]}"
            for i in read_fixture_file(FIXTURE_PATH / "sphinx_directives.md")
        ],
    )
    def test_sphinx_directives(line, title, input, expected):
        # TODO fix skipped directives
        # TODO test domain directives
        if title.startswith("SKIP"):
            pytest.skip(title)
        elif title.startswith("SPHINX3") and sphinx.version_info[0] < 3:
            pytest.skip(title)
        elif title.startswith("SPHINX4") and sphinx.version_info[0] < 4:
            pytest.skip(title)
        document = to_docutils(input, in_sphinx_env=True)
        _actual, _expected = [
            "\n".join([ll.rstrip() for ll in text.splitlines()])
            for text in (document.pformat(), expected)
        ]
        try:
>           assert _actual == _expected
E           assert '<document so..."2147483647">' == '<document so...36854775807">'
E             Skipping 84 identical leading characters in diff, use -v to show
E             - hreshold="9223372036854775807">
E             + hreshold="2147483647">

tests/test_renderers/test_fixtures.py:121: AssertionError
----------------------------- Captured stdout call -----------------------------
<document source="notset">
    <highlightlang force="False" lang="something" linenothreshold="2147483647">

=========================== short test summary info ============================
FAILED tests/test_renderers/test_fixtures.py::test_sphinx_directives[35-highlight (`sphinx.directives.code.Highlight`):]

Reproduce the bug

  1. Create a 32-bit environment (or a 32-bit Python)
  2. Run python -m pytest

List your environment

  • Debian unstable.
  • python3-sphinx 4.3.2-1
  • python3-docutils 0.17.1+dfsg-2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions