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

test_guess_language fails with pygments>=2.9.0 #115

Open
mweinelt opened this issue Jun 20, 2021 · 0 comments
Open

test_guess_language fails with pygments>=2.9.0 #115

mweinelt opened this issue Jun 20, 2021 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@mweinelt
Copy link
Contributor

mweinelt commented Jun 20, 2021

Reordered in 2.9.0:

pygments/pygments@3f6244b

_____________________________ test_guess_language ______________________________

    def test_guess_language() -> None:
        # python
        assert (
            utility.guess_language(
                """
          import math
          math.ceil(0.5)
        """
            )
            == "python"
        )
        assert (
            utility.guess_language(
                """
          # this is a comment
        """,
                "__init__.py",
            )
            == "python"
        )

        # bash
        assert (
            utility.guess_language(
                """
          #!/usr/bin/bash
          set -euxo pipefail
        """,
                "script.sh",
            )
            == "bash"
        )

        # php
        assert utility.guess_language(
            """
          <?php
          $var = 0.5;
          abs($var);
        """
        ).endswith(
            "php"
        )  # for some reason this is guessed as js+php

        # yaml
        assert (
            utility.guess_language(
                """
          ---
          one:
            two: 3
            four: five
        """,
                "some.yml",
            )
            == "yaml"
        )

        # rst
>       assert (
            utility.guess_language(
                """
          Title
          =====

          Subtitle
          --------
          - One
          - Two
        """,
                "doc.rst",
            )
            == "rst"
        )
E       AssertionError: assert 'restructuredtext' == 'rst'
E         - rst
E         + restructuredtext

test/test_utility.py:69: AssertionError
=========================== short test summary info ============================
FAILED test/test_utility.py::test_guess_language - AssertionError: assert 're...
========================= 1 failed, 98 passed in 6.57s =========================
@supakeen supakeen self-assigned this Apr 20, 2022
@supakeen supakeen added the bug Something isn't working label Apr 20, 2022
@supakeen supakeen added this to the 1.4.0 milestone Apr 20, 2022
@supakeen supakeen removed their assignment Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants