From 5b23e2efb62c2c4cfe49651bf57a5d2262a1436b61f5c1e425485da55fa35e9e Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 22 Jul 2024 11:57:02 +0000 Subject: [PATCH] Accepting request 1189009 from home:glaubitz:branches:devel:languages:python - Cherry-pick upstream patch to fix tests with Python 3.13 * fix-tests-with-python3.13.patch OBS-URL: https://build.opensuse.org/request/show/1189009 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parameterized?expand=0&rev=40 --- fix-tests-with-python3.13.patch | 41 +++++++++++++++++++++++++++++++++ python-parameterized.changes | 6 +++++ python-parameterized.spec | 4 +++- 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 fix-tests-with-python3.13.patch 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 b26d793..94e9d35 100644 --- a/python-parameterized.changes +++ b/python-parameterized.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/python-parameterized.spec b/python-parameterized.spec index 4fce8a7..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 @@ -40,6 +40,8 @@ Patch1: remove_nose.patch 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}