Fix a test case with Pygments 2.12.0

Resolves: rhbz#2081903
epel9
Charalampos Stratakis 3 years ago
parent 68124d6b10
commit 0551da3102

@ -0,0 +1,13 @@
diff --git a/tests/test_traceback.py b/tests/test_traceback.py
index 2830e26aa..03705f99c 100644
--- a/tests/test_traceback.py
+++ b/tests/test_traceback.py
@@ -277,7 +277,7 @@ def test_guess_lexer_yaml_j2():
something: {{ raiser() }}
else: {{ 5 + 5 }}
"""
- assert Traceback._guess_lexer("test.yaml.j2", code) == "text"
+ assert Traceback._guess_lexer("test.yaml.j2", code) in ("text", "YAML+Jinja")
def test_recursive():

@ -10,6 +10,10 @@ URL: https://github.com/Textualize/rich
Source0: %{url}/archive/v%{version}/rich-%{version}.tar.gz
BuildArch: noarch
# Fix a test with Pygments 2.12.0
# Resolved upstream: https://github.com/Textualize/rich/commit/e2332480eba780be2090b5cc98bee21874d13f33
Patch0: pygments-2.12.0-test-fix.patch
BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros
# for checks
@ -34,7 +38,7 @@ also render pretty tables, progress bars, markdown, syntax highlighted source
code, tracebacks, and more — out of the box.
%prep
%autosetup -n %{pypi_name}-%{version}
%autosetup -p1 -n %{pypi_name}-%{version}
%generate_buildrequires
%pyproject_buildrequires -r

Loading…
Cancel
Save