Skip to content

tests/test_html_formatter.py::test_ctags fails when python-ctags3 is installed #2486

@mgorny

Description

@mgorny

When the python-ctags3 package is installed, the test suite fails:

============================================================== FAILURES ===============================================================
_____________________________________________________________ test_ctags ______________________________________________________________

    def test_ctags():
        try:
            import ctags # noqa: F401
        except ImportError:
            # we can't check without the ctags module, but at least check the exception
            assert pytest.raises(
                RuntimeError, HtmlFormatter, tagsfile='support/tags'
            )
        else:
            # this tagfile says that test_ctags() is on line 165, even if it isn't
            # anymore in the actual source
>           fmt = HtmlFormatter(tagsfile='support/tags', lineanchors='L',
                                tagurlformat='%(fname)s%(fext)s')

tests/test_html_formatter.py:243: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pygments/formatters/html.py:432: in __init__
    self._ctags = ctags.CTags(self.tagsfile)
src/_readtags.pyx:91: in _readtags.CTags.__cinit__
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   Exception: Invalid tag file

src/_readtags.pyx:131: Exception

To reproduce:

tox e -e py311 -- pip install python-ctags3
tox r -e py311

Full test log: test.log

Reproduced on Python 3.11.4, Gentoo Linux amd64, git @ 9162c07 (i.e. 2.16.1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions