diff --git a/fix-assert-method.patch b/fix-assert-method.patch new file mode 100644 index 0000000..61a8b27 --- /dev/null +++ b/fix-assert-method.patch @@ -0,0 +1,24 @@ +From d64843df5f339f486a9b29d492f2988a3bf8485b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= +Date: Tue, 2 May 2023 13:48:00 +0200 +Subject: [PATCH] Remove the usage of assertRaisesRegexp unit test alias + removed in Python 3.12 + +https://bugs.python.org/issue?@action=redirect&bpo=45162 +--- + parameterized/test.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/parameterized/test.py b/parameterized/test.py +index 6c71f79..498c591 100644 +--- a/parameterized/test.py ++++ b/parameterized/test.py +@@ -35,7 +35,7 @@ def assert_raises_regexp_decorator(expected_exception, expected_regexp): + def func_decorator(func): + @wraps(func) + def wrapper(self, *args, **kwargs): +- with self.assertRaisesRegexp(expected_exception, expected_regexp): ++ with self.assertRaisesRegex(expected_exception, expected_regexp): + func(self, *args, **kwargs) + + return wrapper diff --git a/fix-tests-with-python3.13.patch b/fix-tests-with-python3.13.patch new file mode 100644 index 0000000..02cbc29 --- /dev/null +++ b/fix-tests-with-python3.13.patch @@ -0,0 +1,41 @@ +From b08a1f287d379d13fe51239712a4d570bd0c556d Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Mon, 30 Oct 2023 10:38:27 -0400 +Subject: [PATCH 1/2] Fix tests to handle Python 3.13 stripping indents from + docstrings + +https://docs.python.org/3.13/whatsnew/3.13.html#other-language-changes + +https://github.com/python/cpython/issues/81283 +--- + parameterized/test.py | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +diff --git a/parameterized/test.py b/parameterized/test.py +index 6c71f79..6419171 100644 +--- a/parameterized/test.py ++++ b/parameterized/test.py +@@ -408,10 +408,16 @@ class TestParameterizedExpandDocstring(TestCase): + """Documentation. + + More""" +- self._assert_docstring( +- "Documentation [with foo=%r].\n\n" +- " More" %(foo, ) +- ) ++ if sys.version_info[:2] < (3, 13): ++ self._assert_docstring( ++ "Documentation [with foo=%r].\n\n" ++ " More" %(foo, ) ++ ) ++ else: ++ self._assert_docstring( ++ "Documentation [with foo=%r].\n\n" ++ "More" %(foo, ) ++ ) + + @parameterized.expand([param("foo")]) + def test_unicode_docstring(self, foo): +-- +2.45.2 + diff --git a/python-parameterized.changes b/python-parameterized.changes index f6ed4c3..94e9d35 100644 --- a/python-parameterized.changes +++ b/python-parameterized.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Mon Jul 22 11:26:38 UTC 2024 - John Paul Adrian Glaubitz + +- Cherry-pick upstream patch to fix tests with Python 3.13 + * fix-tests-with-python3.13.patch + +------------------------------------------------------------------- +Tue Aug 15 09:02:40 UTC 2023 - Steve Kowalik + +- Add patch fix-assert-method.patch: + * Use correct assertion method. + ------------------------------------------------------------------- Fri May 12 09:54:40 UTC 2023 - Matej Cepl @@ -96,6 +108,11 @@ Tue Jun 2 14:26:24 UTC 2020 - pgajdos@suse.com @duncwebb et al; https://github.com/wolever/parameterized/pull/74) - drop dependency on unittest2 +------------------------------------------------------------------- +Fri Dec 13 12:49:20 UTC 2019 - John Paul Adrian Glaubitz + +- Include in SLE-15 (bsc#1159018, jsc#PM-1507) + ------------------------------------------------------------------- Thu Dec 5 15:52:40 CET 2019 - Matej Cepl @@ -107,7 +124,7 @@ Thu Dec 5 15:52:40 CET 2019 - Matej Cepl ------------------------------------------------------------------- Tue Nov 5 09:31:02 UTC 2019 - Ondřej Súkup -- remove pytest test, enable other test frameworks +- remove pytest test, enable other test frameworks ------------------------------------------------------------------- Wed Aug 21 14:41:30 UTC 2019 - Tomáš Chvátal diff --git a/python-parameterized.spec b/python-parameterized.spec index 9e8d6e6..43982df 100644 --- a/python-parameterized.spec +++ b/python-parameterized.spec @@ -1,7 +1,7 @@ # # spec file for package python-parameterized # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -38,6 +38,10 @@ Patch1: remove_nose.patch # PATCH-FIX-UPSTREAM skip_failing_teardown.patch gh#wolever/parameterized#167 mcepl@suse.com # skip failing assert in tearDownModule [sic] Patch2: skip_failing_teardown.patch +# PATCH-FIX-UPSTREAM gh#wolever/parameterized#169 +Patch3: fix-assert-method.patch +# PATCH-FIX-UPSTREAM gh#wolever/parameterized#176 +Patch4: fix-tests-with-python3.13.patch BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module wheel} @@ -80,6 +84,6 @@ skip_tests="test_with_docstring_1_v_l_ or test_with_docstring_0_value1" # %%doc CHANGELOG.txt %license LICENSE.txt %{python_sitelib}/parameterized -%{python_sitelib}/parameterized-%{version}*-info +%{python_sitelib}/parameterized-%{version}.dist-info %changelog