{"action":"created","issue":{"url":"https://api.github.com/repos/testing-cabal/mock/issues/438","repository_url":"https://api.github.com/repos/testing-cabal/mock","labels_url":"https://api.github.com/repos/testing-cabal/mock/issues/438/labels{/name}","comments_url":"https://api.github.com/repos/testing-cabal/mock/issues/438/comments","events_url":"https://api.github.com/repos/testing-cabal/mock/issues/438/events","html_url":"https://github.com/testing-cabal/mock/issues/438","id":385627631,"node_id":"MDU6SXNzdWUzODU2Mjc2MzE=","number":438,"title":"fix pypy test failure.","user":{"login":"cjw296","id":632049,"node_id":"MDQ6VXNlcjYzMjA0OQ==","avatar_url":"https://avatars3.githubusercontent.com/u/632049?v=4","gravatar_id":"","url":"https://api.github.com/users/cjw296","html_url":"https://github.com/cjw296","followers_url":"https://api.github.com/users/cjw296/followers","following_url":"https://api.github.com/users/cjw296/following{/other_user}","gists_url":"https://api.github.com/users/cjw296/gists{/gist_id}","starred_url":"https://api.github.com/users/cjw296/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjw296/subscriptions","organizations_url":"https://api.github.com/users/cjw296/orgs","repos_url":"https://api.github.com/users/cjw296/repos","events_url":"https://api.github.com/users/cjw296/events{/privacy}","received_events_url":"https://api.github.com/users/cjw296/received_events","type":"User","site_admin":false},"labels":[{"id":202498129,"node_id":"MDU6TGFiZWwyMDI0OTgxMjk=","url":"https://api.github.com/repos/testing-cabal/mock/labels/bug","name":"bug","color":"fc2929","default":true},{"id":202498132,"node_id":"MDU6TGFiZWwyMDI0OTgxMzI=","url":"https://api.github.com/repos/testing-cabal/mock/labels/help%20wanted","name":"help wanted","color":"159818","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-29T08:47:59Z","updated_at":"2018-12-13T11:42:16Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I'm going to stop the pypy job from failing the Travis CI build.\r\nOpening this bug to fix the failure and then revert the change to allow pypi failures."},"comment":{"url":"https://api.github.com/repos/testing-cabal/mock/issues/comments/446939347","html_url":"https://github.com/testing-cabal/mock/issues/438#issuecomment-446939347","issue_url":"https://api.github.com/repos/testing-cabal/mock/issues/438","id":446939347,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjkzOTM0Nw==","user":{"login":"tirkarthi","id":3972343,"node_id":"MDQ6VXNlcjM5NzIzNDM=","avatar_url":"https://avatars3.githubusercontent.com/u/3972343?v=4","gravatar_id":"","url":"https://api.github.com/users/tirkarthi","html_url":"https://github.com/tirkarthi","followers_url":"https://api.github.com/users/tirkarthi/followers","following_url":"https://api.github.com/users/tirkarthi/following{/other_user}","gists_url":"https://api.github.com/users/tirkarthi/gists{/gist_id}","starred_url":"https://api.github.com/users/tirkarthi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tirkarthi/subscriptions","organizations_url":"https://api.github.com/users/tirkarthi/orgs","repos_url":"https://api.github.com/users/tirkarthi/repos","events_url":"https://api.github.com/users/tirkarthi/events{/privacy}","received_events_url":"https://api.github.com/users/tirkarthi/received_events","type":"User","site_admin":false},"created_at":"2018-12-13T11:42:16Z","updated_at":"2018-12-13T11:42:16Z","author_association":"NONE","body":"Interesting :) here is a simple reproducer of the pypy error.\r\n\r\n```python\r\ntry:\r\n    from mock import *\r\nexcept ImportError:\r\n    from unittest.mock import *\r\n\r\nmock = create_autospec(dict)\r\nmock.pop(3)\r\nmock.pop.assert_called_with(3)\r\n```\r\n\r\nPython 2.7.14 - passes\r\nCPython master - passes\r\npypy 5.8.0 - fails\r\n\r\n```python\r\nTraceback (most recent call last):\r\n  File \"foo.py\", line 7, in <module>\r\n    mock.pop(3)\r\n  File \"/tmp/pypy-env/site-packages/mock/mock.py\", line 1064, in __call__\r\n    _mock_self._mock_check_sig(*args, **kwargs)\r\n  File \"/tmp/pypy-env/site-packages/mock/mock.py\", line 212, in checksig\r\n    sig.bind(*args, **kwargs)\r\n  File \"/tmp/pypy-env/site-packages/funcsigs/__init__.py\", line 792, in bind\r\n    return args[0]._bind(args[1:], kwargs)\r\n  File \"/tmp/pypy-env/site-packages/funcsigs/__init__.py\", line 717, in _bind\r\n    raise TypeError(msg)\r\nTypeError: 'default' parameter lacking default value\r\n```\r\n\r\nI tried adding adding print statements in the mock library inside `_get_signature_object` where the signature is returned. For pypy it actually tries to copy the whole dict object properties thus trying to set the signature. Trying to print `func`, `sig_func` and `inspectgetsignature(sig_func)`. The output on pypy is as below. I have snipped since it's very lengthy but it tries to set the signature of all the methods of a dict and also twice?\r\n\r\n```\r\n(<bound method type.__call__ of <type 'dict'>>, <_functools.partial object at 0x000000010f2277f8>)\r\n(*args, **keywords)\r\n(<bound method type.__call__ of <type 'dict'>>, <_functools.partial object at 0x000000010f227830>)\r\n(*args, **keywords)\r\n(<unbound method dict.clear>, <_functools.partial object at 0x000000010f227868>)\r\n()\r\n(<unbound method dict.clear>, <_functools.partial object at 0x000000010f536f00>)\r\n()\r\n(<unbound method dict.copy>, <_functools.partial object at 0x000000010f536f38>)\r\n()\r\n(<unbound method dict.copy>, <_functools.partial object at 0x000000010f536f70>)\r\n()\r\n(<bound method type.fromkeys of <type 'dict'>>, <bound method type.fromkeys of <type 'dict'>>)\r\n(keys, fill)\r\n(<bound method type.fromkeys of <type 'dict'>>, <bound method type.fromkeys of <type 'dict'>>)\r\n(keys, fill)\r\n[snip]\r\n(<unbound method dict.keys>, <_functools.partial object at 0x000000010f5c0c60>)\r\n()\r\n(<unbound method dict.keys>, <_functools.partial object at 0x000000010f5c0c98>)\r\n()\r\n(<unbound method dict.pop>, <_functools.partial object at 0x000000010f5c0cd0>)\r\n(key, default)\r\n(<unbound method dict.pop>, <_functools.partial object at 0x000000010f5d99f0>)\r\n(key, default)\r\n[snip]\r\n(<unbound method dict.viewvalues>, <_functools.partial object at 0x000000010f600528>)\r\n()\r\n(<unbound method dict.viewvalues>, <_functools.partial object at 0x000000010f600560>)\r\n()\r\n```\r\n\r\nThis specific line sets the signature for `pop` as `(key, default)`\r\n\r\n```\r\n(<unbound method dict.pop>, <_functools.partial object at 0x000000010f5c0cd0>)\r\n(key, default)\r\n```\r\n\r\nMeanwhile on python 2.7.14 this block produces `ValueError` returning no signature. On CPython master it gives below : \r\n\r\n```\r\nfunctools.partial(<slot wrapper '__init__' of 'dict' objects>, None) <slot wrapper '__init__' of 'dict' objects>\r\n(*args, **kwargs)\r\nfunctools.partial(<slot wrapper '__init__' of 'dict' objects>, None) <slot wrapper '__init__' of 'dict' objects>\r\n(*args, **kwargs)\r\nfunctools.partial(<method-wrapper '__call__' of type object at 0x10bb601c0>, None) <method-wrapper '__call__' of type object at 0x10bb601c0>\r\n(*args, **kwargs)\r\nfunctools.partial(<method-wrapper '__call__' of type object at 0x10bb601c0>, None) <method-wrapper '__call__' of type object at 0x10bb601c0>\r\n(*args, **kwargs)\r\nfunctools.partial(<method-wrapper '__call__' of method_descriptor object at 0x10bd4ca60>, None) <method-wrapper '__call__' of method_descriptor object at 0x10bd4ca60>\r\n(*args, **kwargs)\r\n<method-wrapper '__call__' of method_descriptor object at 0x10bd4ca60> <method-wrapper '__call__' of method_descriptor object at 0x10bd4ca60>\r\n(*args, **kwargs)\r\n```\r\n\r\nSo pypy does something along copying all methods of `dict` with it's original signature. I tried getting to the point where pypy last passes but the logs on Travis were are all `null` with Travis passed. So I don't know how it broke. I will try some more debugging once I get some more time."}}
{"actor":{"display_login":"tirkarthi"}}