summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathy Vanvoorden <mathy@vanvoorden.be>2016-10-16 23:24:06 +0200
committerDavid Seifert <soap@gentoo.org>2016-10-18 22:02:22 +0200
commitfd9a5a0a3c15d7400b936ce0f0814fd4078e900c (patch)
tree85e45c61f492ae49bfed6b6277462a124bc2e8e0 /dev-python/funcsigs
parentdev-python/funcsigs: revision bump 1.0.2-r1 (diff)
downloadgentoo-fd9a5a0a3c15d7400b936ce0f0814fd4078e900c.tar.gz
gentoo-fd9a5a0a3c15d7400b936ce0f0814fd4078e900c.tar.bz2
gentoo-fd9a5a0a3c15d7400b936ce0f0814fd4078e900c.zip
dev-python/funcsigs: fix test issue with pypy3
This commit disables 2 tests because they fail to run with pypy3. This has been reported upstream. Upstream bug: https://github.com/testing-cabal/funcsigs/issues/10 Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=564852 Package-Manager: portage-2.3.0 Closes: https://github.com/gentoo/gentoo/pull/2571 Signed-off-by: David Seifert <soap@gentoo.org>
Diffstat (limited to 'dev-python/funcsigs')
-rw-r--r--dev-python/funcsigs/files/funcsigs-1.0.2-fix-pypy3-tests.patch94
-rw-r--r--dev-python/funcsigs/funcsigs-1.0.2-r1.ebuild7
2 files changed, 101 insertions, 0 deletions
diff --git a/dev-python/funcsigs/files/funcsigs-1.0.2-fix-pypy3-tests.patch b/dev-python/funcsigs/files/funcsigs-1.0.2-fix-pypy3-tests.patch
new file mode 100644
index 000000000000..f4ecec3b6137
--- /dev/null
+++ b/dev-python/funcsigs/files/funcsigs-1.0.2-fix-pypy3-tests.patch
@@ -0,0 +1,94 @@
+diff --git a/tests/test_inspect.py b/tests/test_inspect.py
+index 98d6592..3a2a1f2 100644
+--- a/tests/test_inspect.py
++++ b/tests/test_inspect.py
+@@ -8,6 +8,7 @@ import unittest2 as unittest
+
+ import funcsigs as inspect
+
++import platform
+
+ class TestSignatureObject(unittest.TestCase):
+ @staticmethod
+@@ -409,7 +410,7 @@ def test_signature_on_decorated(self):
+ Ellipsis))
+ """)
+
+- if sys.version_info[0] > 2:
++ if sys.version_info[0] > 2 and platform.python_implementation() != "PyPy":
+ exec("""
+ def test_signature_on_class(self):
+ class C:
+@@ -493,41 +494,44 @@ def test_signature_on_class(self):
+ Ellipsis))
+ """)
+
+- def test_signature_on_callable_objects(self):
+- class Foo(object):
+- def __call__(self, a):
+- pass
++ if platform.python_implementation() != "PyPy":
++ exec("""
++def test_signature_on_callable_objects(self):
++ class Foo(object):
++ def __call__(self, a):
++ pass
+
+- self.assertEqual(self.signature(Foo()),
+- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
+- Ellipsis))
++ self.assertEqual(self.signature(Foo()),
++ ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
++ Ellipsis))
+
+- class Spam(object):
+- pass
+- with self.assertRaisesRegex(TypeError, "is not a callable object"):
+- inspect.signature(Spam())
++ class Spam(object):
++ pass
++ with self.assertRaisesRegex(TypeError, "is not a callable object"):
++ inspect.signature(Spam())
+
+- class Bar(Spam, Foo):
+- pass
++ class Bar(Spam, Foo):
++ pass
+
+- self.assertEqual(self.signature(Bar()),
+- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
+- Ellipsis))
++ self.assertEqual(self.signature(Bar()),
++ ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
++ Ellipsis))
+
+- class ToFail(object):
+- __call__ = type
+- with self.assertRaisesRegex(ValueError, "not supported by signature"):
+- inspect.signature(ToFail())
++ class ToFail(object):
++ __call__ = type
++ with self.assertRaisesRegex(ValueError, "not supported by signature"):
++ inspect.signature(ToFail())
+
+- if sys.version_info[0] < 3:
+- return
++ if sys.version_info[0] < 3:
++ return
+
+- class Wrapped(object):
+- pass
+- Wrapped.__wrapped__ = lambda a: None
+- self.assertEqual(self.signature(Wrapped),
+- ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
+- Ellipsis))
++ class Wrapped(object):
++ pass
++ Wrapped.__wrapped__ = lambda a: None
++ self.assertEqual(self.signature(Wrapped),
++ ((('a', Ellipsis, Ellipsis, "positional_or_keyword"),),
++ Ellipsis))
++""")
+
+ def test_signature_on_lambdas(self):
+ self.assertEqual(self.signature((lambda a=10: a)),
diff --git a/dev-python/funcsigs/funcsigs-1.0.2-r1.ebuild b/dev-python/funcsigs/funcsigs-1.0.2-r1.ebuild
index 01f0536d3ea1..ea3b7a6b6f98 100644
--- a/dev-python/funcsigs/funcsigs-1.0.2-r1.ebuild
+++ b/dev-python/funcsigs/funcsigs-1.0.2-r1.ebuild
@@ -22,6 +22,13 @@ DEPEND="
test? ( dev-python/unittest2[${PYTHON_USEDEP}] )"
RDEPEND=""
+PATCHES=(
+ # This patch disables some tests for pypy as they do not work as expected.
+ # This has been reported upstream
+ # https://github.com/testing-cabal/funcsigs/issues/10
+ "${FILESDIR}/${P}-fix-pypy3-tests.patch"
+)
+
python_test() {
esetup.py test
}