Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple test failures in version 0.4 with pypy3 #10

Open
rbtcollins opened this issue Mar 24, 2016 · 3 comments
Open

multiple test failures in version 0.4 with pypy3 #10

rbtcollins opened this issue Mar 24, 2016 · 3 comments

Comments

@rbtcollins
Copy link
Member

======================================================================
ERROR: test_signature_on_callable_objects (tests.test_inspect.TestSignatureObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmp/portage/dev-python/funcsigs-0.4/work/funcsigs-0.4/tests/test_inspect.py", line 508, in test_signature_on_callable_objects
    self.assertEqual(self.signature(Foo()),
  File "/var/tmp/portage/dev-python/funcsigs-0.4/work/funcsigs-0.4/tests/test_inspect.py", line 17, in signature
    sig = inspect.signature(func)
  File "/var/tmp/portage/dev-python/funcsigs-0.4/work/funcsigs-0.4/funcsigs/__init__.py", line 176, in signature
    raise ValueError('callable {0!r} is not supported by signature'.format(obj))
ValueError: callable <tests.test_inspect.Foo object at 0x0000000001405948> is not supported by signature

======================================================================
ERROR: test_signature_on_class (tests.test_inspect.TestSignatureObject)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "<string>", line 7, in test_signature_on_class
  File "/var/tmp/portage/dev-python/funcsigs-0.4/work/funcsigs-0.4/tests/test_inspect.py", line 17, in signature
    sig = inspect.signature(func)
  File "/var/tmp/portage/dev-python/funcsigs-0.4/work/funcsigs-0.4/funcsigs/__init__.py", line 176, in signature
    raise ValueError('callable {0!r} is not supported by signature'.format(obj))
ValueError: callable <class 'tests.test_inspect.C'> is not supported by signature

----------------------------------------------------------------------

From aliles#18, filed by @jlec

@MathyV
Copy link

MathyV commented Oct 16, 2016

I was looking into why this is occurring and possible create a fix, but I got stuck for the moment. It seems that the behaviour for _get_user_defined_method is different for the different implementations, but my python voodoo isn't strong enough to come up with a solution atm. I'm checking with the pypy devs why the behaviour is different.

This is the simplified testcase:

import types

class Foo(object):
    def __call__(self, a):
        pass

meth = getattr(Foo, "__call__")

w = type(type.__call__)
m = type(all.__call__)

n = (w, m, types.BuiltinFunctionType)

print(isinstance(meth, w))
print(isinstance(meth, m))
print(isinstance(meth, types.BuiltinFunctionType))

print(isinstance(meth, n))

Output:

$ pypy  test-pypy3.py
True
True
False
True
$ python2.7 test-pypy3.py
False
False
False
False
$ pypy3  test-pypy3.py
True
False
False
True
$ python3 test-pypy3.py
False
False
False
False

@MathyV
Copy link

MathyV commented Oct 16, 2016

I checked on #pypy where I was pointed to this page which mentions differences in the inspect module:

http://doc.pypy.org/en/latest/cpython_differences.html#miscellaneous

@MathyV
Copy link

MathyV commented Oct 16, 2016

BTW: the reason it works on pypy is because the failing tests are being ignored by the sys.version_info[0] > 2 check.

MathyV added a commit to MathyV/gentoo that referenced this issue Oct 16, 2016
This commit disables 2 tests because they fail to run with pypy3.
This has been reported upstream.

Upstream bug: testing-cabal/funcsigs#10

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=564852

Package-Manager: portage-2.3.0
gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Oct 18, 2016
This commit disables 2 tests because they fail to run with pypy3.
This has been reported upstream.

Upstream bug: testing-cabal/funcsigs#10

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=564852

Package-Manager: portage-2.3.0
Closes: #2571

Signed-off-by: David Seifert <soap@gentoo.org>
paraenggu pushed a commit to paraenggu/gentoo that referenced this issue Oct 23, 2016
This commit disables 2 tests because they fail to run with pypy3.
This has been reported upstream.

Upstream bug: testing-cabal/funcsigs#10

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=564852

Package-Manager: portage-2.3.0
Closes: gentoo#2571

Signed-off-by: David Seifert <soap@gentoo.org>
thoughtpolice added a commit to thoughtpolice/nixpkgs that referenced this issue May 15, 2019
This package has a spurious test failure on PyPy3, which was reported
upstream a while ago:

     testing-cabal/funcsigs#10

This is fixed thanks to the included patch, which was authored and is
also used by the Gentoo Python team.

With this, packages like 'pytest' and 'click' now work under PyPy3.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
tadeokondrak pushed a commit to tadeokondrak/nixpkgs that referenced this issue May 17, 2019
This package has a spurious test failure on PyPy3, which was reported
upstream a while ago:

     testing-cabal/funcsigs#10

This is fixed thanks to the included patch, which was authored and is
also used by the Gentoo Python team.

With this, packages like 'pytest' and 'click' now work under PyPy3.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants