15
0

Accepting request 970235 from home:bnavigator:branches:devel:languages:python

- Add parameterized-pr116-pytest4.patch for pytest 4 to 7 (!)
  support -- gh#wolever/parameterized#116
- Refresh remove_nose.patch
- Drop skip_Documentation_tests.patch fixed upstream

OBS-URL: https://build.opensuse.org/request/show/970235
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-parameterized?expand=0&rev=24
This commit is contained in:
2022-04-15 04:28:25 +00:00
committed by Git OBS Bridge
parent 92ced78c47
commit 877e19b915
5 changed files with 572 additions and 53 deletions

View File

@@ -3,18 +3,20 @@
parameterized/test.py | 30 ++++++++++++++++--------------
2 files changed, 20 insertions(+), 17 deletions(-)
--- a/parameterized/test.py
+++ b/parameterized/test.py
@@ -4,7 +4,7 @@ import inspect
Index: parameterized-0.8.1/parameterized/test.py
===================================================================
--- parameterized-0.8.1.orig/parameterized/test.py
+++ parameterized-0.8.1/parameterized/test.py
@@ -3,7 +3,7 @@
import inspect
import mock
import sys
from unittest import TestCase, skipIf
from unittest import TestCase
-from nose.tools import assert_equal, assert_raises
+import pytest
from .parameterized import (
PY3, PY2, parameterized, param, parameterized_argument_value_pairs,
@@ -88,12 +88,12 @@ if not PYTEST:
PY3, PY2, PYTEST4, parameterized, param,
@@ -91,12 +91,12 @@ if not PYTEST:
self.actual_order = self.stack.pop(0)
def tearDown(self):
@@ -29,11 +31,11 @@
+ missing_tests.remove("test_setup(%s)" % self.actual_order)
def custom_naming_func(custom_tag):
@@ -236,9 +236,9 @@ class TestParamerizedOnTestCase(TestCase
def custom_naming_func(custom_tag, kw_name):
@@ -248,9 +248,9 @@ class TestParamerizedOnTestCase(TestCase
frame_locals = frame[0].f_locals
nose_test_method_name = frame_locals['a'][0]._testMethodName
expected_name = "test_on_TestCase2_custom_name_" + str(foo)
expected_name = "test_on_TestCase2_custom_name_" + str(foo) + "_" + str(bar)
- assert_equal(nose_test_method_name, expected_name,
- "Test Method name '%s' did not get customized to expected: '%s'" %
- (nose_test_method_name, expected_name))
@@ -43,7 +45,7 @@
missing_tests.remove("%s(%r, bar=%r)" %(expected_name, foo, bar))
@@ -261,7 +261,7 @@ class TestParameterizedExpandDocstring(T
@@ -272,7 +272,7 @@ class TestParameterizedExpandDocstring(T
actual_docstring = test_method.__doc__
if rstrip:
actual_docstring = actual_docstring.rstrip()
@@ -52,7 +54,7 @@
@parameterized.expand([param("foo")],
doc_func=lambda f, n, p: "stuff")
@@ -337,7 +337,7 @@ def test_helpful_error_on_empty_iterable
@@ -348,7 +348,7 @@ def test_helpful_error_on_empty_iterable
def test_skip_test_on_empty_iterable():
func = parameterized([], skip_on_empty=True)(lambda: None)
@@ -61,7 +63,7 @@
def test_helpful_error_on_empty_iterable_input_expand():
@@ -370,7 +370,7 @@ def test_helpful_error_on_non_iterable_i
@@ -381,7 +381,7 @@ def test_helpful_error_on_non_iterable_i
def tearDownModule():
missing = sorted(list(missing_tests))
@@ -70,7 +72,7 @@
def test_old_style_classes():
if PY3:
@@ -420,7 +420,7 @@ class TestOldStyleClass:
@@ -433,7 +433,7 @@ class TestOldStyleClass:
def test_parameterized_argument_value_pairs(func_params, p, expected):
helper = eval("lambda %s: None" %(func_params, ))
actual = parameterized_argument_value_pairs(helper, p)
@@ -79,7 +81,7 @@
@parameterized([
@@ -430,7 +430,7 @@ def test_parameterized_argument_value_pa
@@ -443,7 +443,7 @@ def test_parameterized_argument_value_pa
(123456789, "12...89", 4),
])
def test_short_repr(input, expected, n=6):
@@ -88,7 +90,7 @@
@parameterized([
("foo", ),
@@ -444,7 +444,7 @@ cases_over_10 = [(i, i+1) for i in range
@@ -457,7 +457,7 @@ cases_over_10 = [(i, i+1) for i in range
@parameterized(cases_over_10)
def test_cases_over_10(input, expected):
@@ -97,7 +99,7 @@
@parameterized_class(("a", "b", "c"), [
@@ -461,7 +461,7 @@ class TestParameterizedClass(TestCase):
@@ -476,7 +476,7 @@ class TestParameterizedClass(TestCase):
def _assertions(self, test_name):
assert hasattr(self, "a")
@@ -106,9 +108,11 @@
missing_tests.remove("%s:%s(%r, %r, %r)" %(
self.__class__.__name__,
test_name,
--- a/parameterized/parameterized.py
+++ b/parameterized/parameterized.py
@@ -276,7 +276,7 @@ def default_name_func(func, num, p):
Index: parameterized-0.8.1/parameterized/parameterized.py
===================================================================
--- parameterized-0.8.1.orig/parameterized/parameterized.py
+++ parameterized-0.8.1/parameterized/parameterized.py
@@ -286,7 +286,7 @@ def default_name_func(func, num, p):
_test_runner_override = None
_test_runner_guess = False
@@ -117,12 +121,3 @@
_test_runner_aliases = {
"_pytest": "pytest",
}
@@ -582,7 +582,7 @@ def parameterized_class(attrs, input_val
)
class_name_func = class_name_func or default_class_name_func
-
+
if classname_func:
warnings.warn(
"classname_func= is deprecated; use class_name_func= instead. "