Home - Summaries: (main) : (py3.11) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy.module.math.test.apptest_math:test_signatures

@pytest.mark.skipif(not hasattr(sys, 'pypy_translation_info'), reason='requires translated PyPy')
    def test_signatures():
        import inspect
        assert str(inspect.signature(math.factorial)) == '(n, /)'
        assert str(inspect.signature(math.isqrt)) == '(n, /)'
>       assert str(inspect.signature(math.gcd)) == '(*integers)'

../build/pypy/module/math/test/apptest_math.py:186: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../build/lib-python/3/inspect.py:3348: in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
../build/lib-python/3/inspect.py:3085: in from_callable
    return _signature_from_callable(obj, sigcls=cls,
../build/lib-python/3/inspect.py:2602: in _signature_from_callable
    return _signature_from_builtin(sigcls, obj,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'inspect.Signature'>, func = <built-in function gcd>
skip_bound_arg = True

    def _signature_from_builtin(cls, func, skip_bound_arg=True):
        """Private helper function to get signature for
        builtin callables.
        """
    
        if not _signature_is_builtin(func):
            raise TypeError("{!r} is not a Python builtin "
                            "function".format(func))
    
        s = getattr(func, "__text_signature__", None)
        if not s:
>           raise ValueError("no signature found for builtin {!r}".format(func))
E           ValueError: no signature found for builtin <built-in function gcd>

../build/lib-python/3/inspect.py:2392: ValueError
builder: pypy-c-jit-linux-x86-64 build #11848+
test: pypy.module.math.test.apptest_math:test_signatures