python-funcsigs/no-unittest2.patch
DistroBaker 3141b608d5 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/python-funcsigs.git#6aa6151757e6668fab6079749d70aa88ac1ba779
2020-10-30 15:18:43 +01:00

89 lines
2.8 KiB
Diff

diff -rU3 funcsigs-1.0.2.orig/setup.py funcsigs-1.0.2/setup.py
--- funcsigs-1.0.2.orig/setup.py 2016-04-26 00:01:13.000000000 +0200
+++ funcsigs-1.0.2/setup.py 2019-09-26 17:15:43.693886370 +0200
@@ -47,6 +47,5 @@
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules'
],
- tests_require = ['unittest2'],
- test_suite = 'unittest2.collector',
+ test_suite = 'tests',
)
diff -rU3 funcsigs-1.0.2.orig/tests/test_formatannotation.py funcsigs-1.0.2/tests/test_formatannotation.py
--- funcsigs-1.0.2.orig/tests/test_formatannotation.py 2016-04-05 23:32:14.000000000 +0200
+++ funcsigs-1.0.2/tests/test_formatannotation.py 2019-09-26 16:49:30.174351893 +0200
@@ -1,6 +1,6 @@
import funcsigs
-import unittest2 as unittest
+import unittest
class TestFormatAnnotation(unittest.TestCase):
def test_string (self):
diff -rU3 funcsigs-1.0.2.orig/tests/test_funcsigs.py funcsigs-1.0.2/tests/test_funcsigs.py
--- funcsigs-1.0.2.orig/tests/test_funcsigs.py 2016-04-05 23:32:14.000000000 +0200
+++ funcsigs-1.0.2/tests/test_funcsigs.py 2019-09-26 16:49:26.315366071 +0200
@@ -1,4 +1,4 @@
-import unittest2 as unittest
+import unittest
import doctest
import sys
diff -rU3 funcsigs-1.0.2.orig/tests/test_inspect.py funcsigs-1.0.2/tests/test_inspect.py
--- funcsigs-1.0.2.orig/tests/test_inspect.py 2016-04-05 23:32:14.000000000 +0200
+++ funcsigs-1.0.2/tests/test_inspect.py 2019-09-26 17:05:25.946939291 +0200
@@ -3,13 +3,24 @@
import collections
import functools
import sys
+import contextlib
-import unittest2 as unittest
+import unittest
import funcsigs as inspect
+if not hasattr(unittest.TestCase, 'assertRaisesRegex'):
+ class TestCase(unittest.TestCase):
+ @contextlib.contextmanager
+ def assertRaisesRegex(self, error, message):
+ with self.assertRaises(error) as cm:
+ yield cm
+ self.assertRegexpMatches(str(cm.exception), message)
+else:
+ TestCase = unittest.TestCase
-class TestSignatureObject(unittest.TestCase):
+
+class TestSignatureObject(TestCase):
@staticmethod
def signature(func):
sig = inspect.signature(func)
@@ -647,7 +658,7 @@
""")
-class TestParameterObject(unittest.TestCase):
+class TestParameterObject(TestCase):
def test_signature_parameter_kinds(self):
P = inspect.Parameter
@@ -761,7 +772,7 @@
p.kind = 123
-class TestSignatureBind(unittest.TestCase):
+class TestSignatureBind(TestCase):
@staticmethod
def call(func, *args, **kwargs):
sig = inspect.signature(func)
@@ -975,7 +986,7 @@
self.assertEqual((an_f, 10), partial_f(*ba.args, **ba.kwargs))
-class TestBoundArguments(unittest.TestCase):
+class TestBoundArguments(TestCase):
def test_signature_bound_arguments_unhashable(self):
def foo(a): pass