From 1b0987a52d89a76cd4ebc3fcfcac7278f56a3aad2edf51d771b9656d71169068 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 5 Jul 2023 10:24:03 +0000 Subject: [PATCH] - Add skip-test_catch_handler_raises-for-older-311.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-exceptiongroup?expand=0&rev=17 --- python-exceptiongroup.changes | 2 +- python-exceptiongroup.spec | 6 ++-- ...t_catch_handler_raises-for-older-311.patch | 31 +++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 skip-test_catch_handler_raises-for-older-311.patch diff --git a/python-exceptiongroup.changes b/python-exceptiongroup.changes index ef5f3e6..0484fec 100644 --- a/python-exceptiongroup.changes +++ b/python-exceptiongroup.changes @@ -5,7 +5,7 @@ Tue Jul 4 22:32:27 UTC 2023 - Matej Cepl - Changed handling of exceptions in exception group handler callbacks to not wrap a single exception in an exception group, as per CPython issue gh#python/cpython#103590. -- Skip still failing test_catch_handler_raises +- Add skip-test_catch_handler_raises-for-older-311.patch (gh#agronholm/exceptiongroup#64). ------------------------------------------------------------------- diff --git a/python-exceptiongroup.spec b/python-exceptiongroup.spec index 4fc7441..836ea59 100644 --- a/python-exceptiongroup.spec +++ b/python-exceptiongroup.spec @@ -35,6 +35,9 @@ Summary: Backport of PEP 654 (exception groups) License: MIT AND Python-2.0 URL: https://github.com/agronholm/exceptiongroup Source: https://github.com/agronholm/exceptiongroup/archive/refs/tags/%{version}.tar.gz#/exceptiongroup-%{version}-gh.tar.gz +# PATCH-FIX-UPSTREAM skip-test_catch_handler_raises-for-older-311.patch gh#agronholm/exceptiongroup#64 mcepl@suse.com +# Skip test_catch_handler_raises() on Python 3.11 if the Python version is less than 3.11.4 +Patch0: skip-test_catch_handler_raises-for-older-311.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module flit-scm} BuildRequires: %{python_module pip} @@ -89,8 +92,7 @@ export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %if %{with test} %check -# gh#agronholm/exceptiongroup#64 -%pytest -k 'not test_catch_handler_raises' +%pytest %endif %if !%{with test} diff --git a/skip-test_catch_handler_raises-for-older-311.patch b/skip-test_catch_handler_raises-for-older-311.patch new file mode 100644 index 0000000..754d8ae --- /dev/null +++ b/skip-test_catch_handler_raises-for-older-311.patch @@ -0,0 +1,31 @@ +From 452ba0946347b4e0df950763213f162704bc1eed Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= +Date: Wed, 5 Jul 2023 12:28:15 +0300 +Subject: [PATCH] Skip test_catch_handler_raises() on Python 3.11 if the Python + version is too low + +--- + tests/test_catch_py311.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/tests/test_catch_py311.py b/tests/test_catch_py311.py +index 4351be8..5880f0a 100644 +--- a/tests/test_catch_py311.py ++++ b/tests/test_catch_py311.py +@@ -1,3 +1,5 @@ ++import sys ++ + import pytest + + from exceptiongroup import ExceptionGroup +@@ -121,6 +123,10 @@ def test_catch_full_match(): + pass + + ++@pytest.mark.skipif( ++ sys.version_info < (3, 11, 4), ++ reason="Behavior was changed in 3.11.4", ++) + def test_catch_handler_raises(): + with pytest.raises(RuntimeError, match="new"): + try: