From 3b6d30557a90afe2289d81549dc2f52b176907200282dbe05f5bf0b0786e87d5 Mon Sep 17 00:00:00 2001 From: Nico Krapp Date: Mon, 20 Jan 2025 13:46:56 +0000 Subject: [PATCH] Accepting request 1239029 from home:mcalabkova:branches:devel:languages:python - Add pygments.patch to fix non-skipped tests with Pygments 2.19 OBS-URL: https://build.opensuse.org/request/show/1239029 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-stack-data?expand=0&rev=21 --- pygments.patch | 24 ++++++++++++++++++++++++ python-stack-data.changes | 5 +++++ python-stack-data.spec | 8 +++++--- 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 pygments.patch diff --git a/pygments.patch b/pygments.patch new file mode 100644 index 0000000..39e8454 --- /dev/null +++ b/pygments.patch @@ -0,0 +1,24 @@ +Index: stack_data-0.6.3/tests/test_core.py +=================================================================== +--- stack_data-0.6.3.orig/tests/test_core.py ++++ stack_data-0.6.3/tests/test_core.py +@@ -573,8 +573,8 @@ def test_absolute_filename(): + [ + r".c { color: #(999999|ababab); font-style: italic }", + r".err { color: #a61717; background-color: #e3d2d2 }", +- r".c-ExecutingNode { color: #(999999|ababab); font-style: italic; background-color: #ffff00 }", +- r".err-ExecutingNode { color: #a61717; background-color: #ffff00 }", ++ r".c-ExecutingNode { color: #(999999|ababab); font-style: italic; background-color: #(ffff00|FF0) }", ++ r".err-ExecutingNode { color: #A61717; background-color: #(ffff00|FF0) }", + ] + ) + def test_executing_style_defs(expected): +@@ -582,7 +582,7 @@ def test_executing_style_defs(expected): + formatter = HtmlFormatter(style=style) + style_defs = formatter.get_style_defs() + +- assert re.search(expected, style_defs) ++ assert re.search(expected, style_defs, re.IGNORECASE) + + + def test_example(): diff --git a/python-stack-data.changes b/python-stack-data.changes index 92246de..59dad49 100644 --- a/python-stack-data.changes +++ b/python-stack-data.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jan 20 13:14:44 UTC 2025 - Markéta Machová + +- Add pygments.patch to fix non-skipped tests with Pygments 2.19 + ------------------------------------------------------------------- Mon Nov 27 16:11:39 UTC 2023 - Dirk Müller diff --git a/python-stack-data.spec b/python-stack-data.spec index 0712279..e535833 100644 --- a/python-stack-data.spec +++ b/python-stack-data.spec @@ -1,7 +1,7 @@ # # spec file for package python-stack-data # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,6 +29,8 @@ BuildRequires: %{python_module setuptools >= 44} BuildRequires: %{python_module setuptools_scm >= 3.4.3} BuildRequires: fdupes BuildRequires: python-rpm-macros +# PATCH-FIX-UPSTREAM https://github.com/alexmojaki/stack_data/pull/58 Modify test_executing_style_defs to work with Pygments 2.19 +Patch0: pygments.patch Requires: python-asttokens Requires: python-executing Requires: python-pure-eval @@ -62,8 +64,8 @@ Extract data from python stack frames and tracebacks for informative displays %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -# incompatibility with Pygments -%pytest -k 'not (test_pygments_example or test_example)' +# incompatibility with even older Pygments +%pytest -k 'not ((test_core and test_pygments_example) or (test_serializer and test_example))' %files %{python_files} %{python_sitelib}/stack_data