Compare commits
4 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 444b8eb699 | |||
| 33a0092c35 | |||
| 0be876b6d4 | |||
| 5b23e2efb6 |
41
fix-tests-with-python3.13.patch
Normal file
41
fix-tests-with-python3.13.patch
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
From b08a1f287d379d13fe51239712a4d570bd0c556d Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
|
||||||
|
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
|
||||||
|
|
||||||
@@ -1,3 +1,17 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jul 10 02:30:29 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Add missing BuildRequires on setuptools.
|
||||||
|
- Add patch remove-external-mock.patch:
|
||||||
|
* Remove requirement on external mock module.
|
||||||
|
- Do not run testsuite with pytest, we already do so with unittest.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jul 22 11:26:38 UTC 2024 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
||||||
|
|
||||||
|
- 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 <steven.kowalik@suse.com>
|
Tue Aug 15 09:02:40 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-parameterized
|
# spec file for package python-parameterized
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -40,8 +40,13 @@ Patch1: remove_nose.patch
|
|||||||
Patch2: skip_failing_teardown.patch
|
Patch2: skip_failing_teardown.patch
|
||||||
# PATCH-FIX-UPSTREAM gh#wolever/parameterized#169
|
# PATCH-FIX-UPSTREAM gh#wolever/parameterized#169
|
||||||
Patch3: fix-assert-method.patch
|
Patch3: fix-assert-method.patch
|
||||||
|
# PATCH-FIX-UPSTREAM gh#wolever/parameterized#176
|
||||||
|
Patch4: fix-tests-with-python3.13.patch
|
||||||
|
# PATCH-FIX-UPSTREAM Based on gh#wolever/parameterized#186
|
||||||
|
Patch5: remove-external-mock.patch
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module wheel}
|
BuildRequires: %{python_module wheel}
|
||||||
%if %{with nose2}
|
%if %{with nose2}
|
||||||
BuildRequires: %{python_module nose2}
|
BuildRequires: %{python_module nose2}
|
||||||
@@ -65,16 +70,11 @@ Parameterized testing with any Python test framework.
|
|||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%check
|
%check
|
||||||
# https://github.com/wolever/parameterized/issues/122
|
|
||||||
sed -i 's:import mock:from unittest import mock:' parameterized/test.py
|
|
||||||
export LANG=en_US.UTF8
|
export LANG=en_US.UTF8
|
||||||
%if %{with nose2}
|
%if %{with nose2}
|
||||||
%{python_expand nose2-%$python_version -v -B --pretty-assert}
|
%{python_expand nose2-%$python_version -v -B --pretty-assert}
|
||||||
%endif
|
%endif
|
||||||
%python_exec -m unittest parameterized.test
|
%python_exec -m unittest parameterized.test
|
||||||
# gh#wolever/parameterized#122
|
|
||||||
skip_tests="test_with_docstring_1_v_l_ or test_with_docstring_0_value1"
|
|
||||||
%pytest parameterized/test.py -k "not ($skip_tests)"
|
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
|
|||||||
26
remove-external-mock.patch
Normal file
26
remove-external-mock.patch
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
From caa701915f1ef6a940d9589f91ff0853f930084f Mon Sep 17 00:00:00 2001
|
||||||
|
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
|
||||||
|
Date: Tue, 6 May 2025 10:02:24 -0400
|
||||||
|
Subject: [PATCH] Remove test dependency on PyPI mock
|
||||||
|
|
||||||
|
Use `unittest.mock` from the Python standard library instead.
|
||||||
|
---
|
||||||
|
parameterized/test.py | 3 +--
|
||||||
|
tox.ini | 1 -
|
||||||
|
2 files changed, 1 insertion(+), 3 deletions(-)
|
||||||
|
|
||||||
|
Index: parameterized-0.9.0/parameterized/test.py
|
||||||
|
===================================================================
|
||||||
|
--- parameterized-0.9.0.orig/parameterized/test.py
|
||||||
|
+++ parameterized-0.9.0/parameterized/test.py
|
||||||
|
@@ -2,9 +2,8 @@
|
||||||
|
|
||||||
|
import inspect
|
||||||
|
import sys
|
||||||
|
-import mock
|
||||||
|
from functools import wraps
|
||||||
|
-from unittest import TestCase
|
||||||
|
+from unittest import TestCase, mock
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from .parameterized import (
|
||||||
Reference in New Issue
Block a user