diff --git a/pyproject.toml b/pyproject.toml index 59c8408ed..24c52f750 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ include = ["rich/py.typed"] [tool.poetry.dependencies] python = ">=3.7.0" typing-extensions = { version = ">=4.0.0, <5.0", python = "<3.9" } -pygments = "^2.14.0" +pygments = "^2.13.0" ipywidgets = { version = ">=7.5.1,<9", optional = true } markdown-it-py = "^2.2.0" diff --git a/tests/test_syntax.py b/tests/test_syntax.py index 6b8cfd8b9..308636d80 100644 --- a/tests/test_syntax.py +++ b/tests/test_syntax.py @@ -3,6 +3,7 @@ import sys import tempfile +import pkg_resources import pytest from pygments.lexers import PythonLexer @@ -20,6 +21,9 @@ from .render import render +PYGMENTS_VERSION = pkg_resources.get_distribution("pygments").version +OLD_PYGMENTS = PYGMENTS_VERSION == "2.13.0" + CODE = '''\ def loop_first_last(values: Iterable[T]) -> Iterable[Tuple[bool, bool, T]]: """Iterate and generate a tuple with a flag for first and last value.""" @@ -98,6 +102,7 @@ def test_python_render_simple_passing_lexer_instance(): assert rendered_syntax == expected +@pytest.mark.skipif(OLD_PYGMENTS, reason="Pygments changed their tokenizer") def test_python_render_simple_indent_guides(): syntax = Syntax( CODE, @@ -114,6 +119,7 @@ def test_python_render_simple_indent_guides(): assert rendered_syntax == expected +@pytest.mark.skipif(OLD_PYGMENTS, reason="Pygments changed their tokenizer") def test_python_render_line_range_indent_guides(): syntax = Syntax( CODE,