Skip to content

test_lexer_classes fails with pytest 8.4 #2992

@hrnciar

Description

@hrnciar

Hello,

I am working on updating pytest in Fedora and pygments is one of the affected packages that fails to build. The test_lexer_classes is failing with:

=================================== FAILURES ===================================
_____________________ test_lexer_classes[BashSessionLexer] _____________________

cls = <class 'pygments.lexers.shell.BashSessionLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/console/example.sh-session not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/console/example.sh-session').is_file

tests/test_basic_api.py:71: AssertionError
____________________ test_lexer_classes[DylanConsoleLexer] _____________________

cls = <class 'pygments.lexers.dylan.DylanConsoleLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/dylan-console/console.dylan-console not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/dylan-console/console.dylan-console').is_file

tests/test_basic_api.py:71: AssertionError
_____________________ test_lexer_classes[GAPConsoleLexer] ______________________

cls = <class 'pygments.lexers.algebra.GAPConsoleLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/gap-repl/euclidean.tst not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/gap-repl/euclidean.tst').is_file

tests/test_basic_api.py:71: AssertionError
____________________ test_lexer_classes[JuliaConsoleLexer] _____________________

cls = <class 'pygments.lexers.julia.JuliaConsoleLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/jlcon/console not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/jlcon/console').is_file

tests/test_basic_api.py:71: AssertionError
____________________ test_lexer_classes[MSDOSSessionLexer] _____________________

cls = <class 'pygments.lexers.shell.MSDOSSessionLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/doscon/session not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/doscon/session').is_file

tests/test_basic_api.py:71: AssertionError
____________________ test_lexer_classes[MatlabSessionLexer] ____________________

cls = <class 'pygments.lexers.matlab.MatlabSessionLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/matlabsession/matlabsession_sample.txt not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/matlabsession/matlabsession_sample.txt').is_file

tests/test_basic_api.py:71: AssertionError
_______________________ test_lexer_classes[OutputLexer] ________________________

cls = <class 'pygments.lexers.special.OutputLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/output/output not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/output/output').is_file

tests/test_basic_api.py:71: AssertionError
___________________ test_lexer_classes[PostgresConsoleLexer] ___________________

cls = <class 'pygments.lexers.sql.PostgresConsoleLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/psql/psql_session.txt not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/psql/psql_session.txt').is_file

tests/test_basic_api.py:71: AssertionError
__________________ test_lexer_classes[PowerShellSessionLexer] __________________

cls = <class 'pygments.lexers.shell.PowerShellSessionLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/pwsh-session/session not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/pwsh-session/session').is_file

tests/test_basic_api.py:71: AssertionError
______________________ test_lexer_classes[RConsoleLexer] _______________________

cls = <class 'pygments.lexers.r.RConsoleLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/rconsole/r-console-transcript.Rout not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/rconsole/r-console-transcript.Rout').is_file

tests/test_basic_api.py:71: AssertionError
_____________________ test_lexer_classes[RubyConsoleLexer] _____________________

cls = <class 'pygments.lexers.ruby.RubyConsoleLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/rbcon/console not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/rbcon/console').is_file

tests/test_basic_api.py:71: AssertionError
____________________ test_lexer_classes[SqliteConsoleLexer] ____________________

cls = <class 'pygments.lexers.sql.SqliteConsoleLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/sqlite3/sqlite3.sqlite3-console not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/sqlite3/sqlite3.sqlite3-console').is_file

tests/test_basic_api.py:71: AssertionError
_____________________ test_lexer_classes[TcshSessionLexer] _____________________

cls = <class 'pygments.lexers.shell.TcshSessionLexer'>

    @pytest.mark.parametrize('cls', lexers._iter_lexerclasses(plugins=False))
    def test_lexer_classes(cls):
        # test that every lexer class has the correct public API
        assert isinstance(cls.name, str)
        for attr in 'aliases', 'filenames', 'alias_filenames', 'mimetypes':
            assert hasattr(cls, attr)
            assert isinstance(getattr(cls, attr), list), \
                f"{cls}: {attr} attribute wrong"
        assert isinstance(cls.url, str), \
            (f"Lexer class {cls.__name__} is missing the `url` attribute. "
             "Please add it to provide a link to the language's homepage "
             "for the Pygments documentation (or set it to an empty "
             "string if this doesn't make sense for the lexer).")
        assert isinstance(cls.version_added, str), \
            (f"Lexer class {cls.__name__} is missing the `version_added` attribute. "
             f"Please add `version_added = '{major}.{minor+1}'` to the class definition.")
        if cls.version_added:
            assert re.fullmatch(r"\d+\.\d+", cls.version_added), \
                (f"Lexer class {cls.__name__} has a wrong version_added attribute. "
                 "It should be a version number like <major>.<minor> (but not "
                 "<major>.<minor>.<micro>).")
        if cls._example is not None:
            assert isinstance(cls._example, str)
            p = (
                pathlib.Path(inspect.getabsfile(pygments)).parent.parent
                / "tests"
                / "examplefiles"
                / cls._example
            )
>           assert p.is_file(), f"Example file {p} not found"
E           AssertionError: Example file /builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/tcshcon/session not found
E           assert False
E            +  where False = is_file()
E            +    where is_file = PosixPath('/builddir/build/BUILD/python-pygments-2.19.1-build/BUILDROOT/usr/lib/python3.14/site-packages/tests/examplefiles/tcshcon/session').is_file

tests/test_basic_api.py:71: AssertionError
=========================== short test summary info ============================
FAILED tests/test_basic_api.py::test_lexer_classes[BashSessionLexer] - Assert...
FAILED tests/test_basic_api.py::test_lexer_classes[DylanConsoleLexer] - Asser...
FAILED tests/test_basic_api.py::test_lexer_classes[GAPConsoleLexer] - Asserti...
FAILED tests/test_basic_api.py::test_lexer_classes[JuliaConsoleLexer] - Asser...
FAILED tests/test_basic_api.py::test_lexer_classes[MSDOSSessionLexer] - Asser...
FAILED tests/test_basic_api.py::test_lexer_classes[MatlabSessionLexer] - Asse...
FAILED tests/test_basic_api.py::test_lexer_classes[OutputLexer] - AssertionEr...
FAILED tests/test_basic_api.py::test_lexer_classes[PostgresConsoleLexer] - As...
FAILED tests/test_basic_api.py::test_lexer_classes[PowerShellSessionLexer] - ...
FAILED tests/test_basic_api.py::test_lexer_classes[RConsoleLexer] - Assertion...
FAILED tests/test_basic_api.py::test_lexer_classes[RubyConsoleLexer] - Assert...
FAILED tests/test_basic_api.py::test_lexer_classes[SqliteConsoleLexer] - Asse...
FAILED tests/test_basic_api.py::test_lexer_classes[TcshSessionLexer] - Assert...
================= 13 failed, 5162 passed, 16 skipped in 19.02s =================

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