{"action":"created","comment":{"url":"https://api.github.com/repos/python/cpython/pulls/comments/238115714","pull_request_review_id":180578954,"id":238115714,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODExNTcxNA==","diff_hunk":"@@ -977,46 +977,51 @@ def _mock_call(_mock_self, *args, **kwargs):\n         self = _mock_self\n         self.called = True\n         self.call_count += 1\n-        _new_name = self._mock_new_name\n-        _new_parent = self._mock_new_parent\n \n+        # handle call_args\n         _call = _Call((args, kwargs), two=True)\n         self.call_args = _call\n         self.call_args_list.append(_call)\n-        self.mock_calls.append(_Call(('', args, kwargs)))\n \n         seen = set()\n-        skip_next_dot = _new_name == '()'\n+\n+        # initial stuff for method_calls:\n         do_method_calls = self._mock_parent is not None\n-        name = self._mock_name\n-        while _new_parent is not None:\n-            this_mock_call = _Call((_new_name, args, kwargs))\n-            if _new_parent._mock_new_name:\n-                dot = '.'\n-                if skip_next_dot:\n-                    dot = ''\n+        method_call_name = self._mock_name\n \n-                skip_next_dot = False\n-                if _new_parent._mock_new_name == '()':\n-                    skip_next_dot = True\n+        # initial stuff for mock_calls:\n+        mock_call_name = self._mock_new_name\n+        is_a_call = mock_call_name == '()'\n+        self.mock_calls.append(_Call(('', args, kwargs)))\n \n-                _new_name = _new_parent._mock_new_name + dot + _new_name\n+        # follow up the chain of mocks:\n+        _new_parent = self._mock_new_parent\n+        while _new_parent is not None:\n \n+            # handle method_calls:\n             if do_method_calls:\n-                if _new_name == name:\n-                    this_method_call = this_mock_call\n-                else:\n-                    this_method_call = _Call((name, args, kwargs))\n-                _new_parent.method_calls.append(this_method_call)\n-\n+                _new_parent.method_calls.append(_Call((method_call_name, args, kwargs)))\n                 do_method_calls = _new_parent._mock_parent is not None\n                 if do_method_calls:\n-                    name = _new_parent._mock_name + '.' + name\n+                    method_call_name = _new_parent._mock_name + '.' + method_call_name\n \n+            # handle mock_calls:\n+            this_mock_call = _Call((mock_call_name, args, kwargs))\n             _new_parent.mock_calls.append(this_mock_call)\n+\n+            if _new_parent._mock_new_name:\n+                if is_a_call:\n+                    dot = ''\n+                else:\n+                    dot = '.'\n+                is_a_call = _new_parent._mock_new_name == '()'\n+                mock_call_name = _new_parent._mock_new_name + dot + mock_call_name","path":"Lib/unittest/mock.py","position":64,"original_position":64,"commit_id":"d807f864c51e82a36e94a76e142affeef89db281","original_commit_id":"7013edb216cbdd334b4462f0458d7280a0659c9c","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},"body":"Yes.","created_at":"2018-12-02T21:37:09Z","updated_at":"2018-12-02T21:37:09Z","html_url":"https://github.com/python/cpython/pull/10555#discussion_r238115714","pull_request_url":"https://api.github.com/repos/python/cpython/pulls/10555","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/python/cpython/pulls/comments/238115714"},"html":{"href":"https://github.com/python/cpython/pull/10555#discussion_r238115714"},"pull_request":{"href":"https://api.github.com/repos/python/cpython/pulls/10555"}},"in_reply_to_id":238111029},"pull_request":{"url":"https://api.github.com/repos/python/cpython/pulls/10555","id":231087768,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxMDg3NzY4","html_url":"https://github.com/python/cpython/pull/10555","diff_url":"https://github.com/python/cpython/pull/10555.diff","patch_url":"https://github.com/python/cpython/pull/10555.patch","issue_url":"https://api.github.com/repos/python/cpython/issues/10555","number":10555,"state":"open","locked":false,"title":"bpo-35226: Fix equality for nested unittest.mock.call objects.","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},"body":"<!--\r\nThanks for your contribution!\r\nPlease read this comment in its entirety. It's quite important.\r\n\r\n# Pull Request title\r\n\r\nIt should be in the following format:\r\n\r\n```\r\nbpo-NNNN: Summary of the changes made\r\n```\r\n\r\nWhere: bpo-NNNN refers to the issue number in the https://bugs.python.org.\r\n\r\nMost PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue.\r\n\r\n# Backport Pull Request title\r\n\r\nIf this is a backport PR (PR made against branches other than `master`),\r\nplease ensure that the PR title is in the following format:\r\n\r\n```\r\n[X.Y] <title from the original PR> (GH-NNNN)\r\n```\r\n\r\nWhere: [X.Y] is the branch name, e.g. [3.6].\r\n\r\nGH-NNNN refers to the PR number from `master`.\r\n\r\n-->\r\n\n\n<!-- issue-number: [bpo-35226](https://bugs.python.org/issue35226) -->\nhttps://bugs.python.org/issue35226\n<!-- /issue-number -->\n","created_at":"2018-11-15T06:57:18Z","updated_at":"2018-12-02T21:37:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81139bdeb2bf67feb210a48180a541e43579a29a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":536945472,"node_id":"MDU6TGFiZWw1MzY5NDU0NzI=","url":"https://api.github.com/repos/python/cpython/labels/CLA%20signed","name":"CLA signed","color":"0e8a16","default":false},{"id":666979821,"node_id":"MDU6TGFiZWw2NjY5Nzk4MjE=","url":"https://api.github.com/repos/python/cpython/labels/awaiting%20review","name":"awaiting review","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/python/cpython/pulls/10555/commits","review_comments_url":"https://api.github.com/repos/python/cpython/pulls/10555/comments","review_comment_url":"https://api.github.com/repos/python/cpython/pulls/comments{/number}","comments_url":"https://api.github.com/repos/python/cpython/issues/10555/comments","statuses_url":"https://api.github.com/repos/python/cpython/statuses/d807f864c51e82a36e94a76e142affeef89db281","head":{"label":"cjw296:issue35226_mock_call_equality","ref":"issue35226_mock_call_equality","sha":"d807f864c51e82a36e94a76e142affeef89db281","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},"repo":{"id":157664477,"node_id":"MDEwOlJlcG9zaXRvcnkxNTc2NjQ0Nzc=","name":"cpython","full_name":"cjw296/cpython","private":false,"owner":{"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},"html_url":"https://github.com/cjw296/cpython","description":"The Python programming language","fork":true,"url":"https://api.github.com/repos/cjw296/cpython","forks_url":"https://api.github.com/repos/cjw296/cpython/forks","keys_url":"https://api.github.com/repos/cjw296/cpython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cjw296/cpython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cjw296/cpython/teams","hooks_url":"https://api.github.com/repos/cjw296/cpython/hooks","issue_events_url":"https://api.github.com/repos/cjw296/cpython/issues/events{/number}","events_url":"https://api.github.com/repos/cjw296/cpython/events","assignees_url":"https://api.github.com/repos/cjw296/cpython/assignees{/user}","branches_url":"https://api.github.com/repos/cjw296/cpython/branches{/branch}","tags_url":"https://api.github.com/repos/cjw296/cpython/tags","blobs_url":"https://api.github.com/repos/cjw296/cpython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cjw296/cpython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cjw296/cpython/git/refs{/sha}","trees_url":"https://api.github.com/repos/cjw296/cpython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cjw296/cpython/statuses/{sha}","languages_url":"https://api.github.com/repos/cjw296/cpython/languages","stargazers_url":"https://api.github.com/repos/cjw296/cpython/stargazers","contributors_url":"https://api.github.com/repos/cjw296/cpython/contributors","subscribers_url":"https://api.github.com/repos/cjw296/cpython/subscribers","subscription_url":"https://api.github.com/repos/cjw296/cpython/subscription","commits_url":"https://api.github.com/repos/cjw296/cpython/commits{/sha}","git_commits_url":"https://api.github.com/repos/cjw296/cpython/git/commits{/sha}","comments_url":"https://api.github.com/repos/cjw296/cpython/comments{/number}","issue_comment_url":"https://api.github.com/repos/cjw296/cpython/issues/comments{/number}","contents_url":"https://api.github.com/repos/cjw296/cpython/contents/{+path}","compare_url":"https://api.github.com/repos/cjw296/cpython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cjw296/cpython/merges","archive_url":"https://api.github.com/repos/cjw296/cpython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cjw296/cpython/downloads","issues_url":"https://api.github.com/repos/cjw296/cpython/issues{/number}","pulls_url":"https://api.github.com/repos/cjw296/cpython/pulls{/number}","milestones_url":"https://api.github.com/repos/cjw296/cpython/milestones{/number}","notifications_url":"https://api.github.com/repos/cjw296/cpython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cjw296/cpython/labels{/name}","releases_url":"https://api.github.com/repos/cjw296/cpython/releases{/id}","deployments_url":"https://api.github.com/repos/cjw296/cpython/deployments","created_at":"2018-11-15T06:40:00Z","updated_at":"2018-11-15T06:40:23Z","pushed_at":"2018-11-30T18:45:08Z","git_url":"git://github.com/cjw296/cpython.git","ssh_url":"git@github.com:cjw296/cpython.git","clone_url":"https://github.com/cjw296/cpython.git","svn_url":"https://github.com/cjw296/cpython","homepage":"https://www.python.org/","size":256689,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"python:master","ref":"master","sha":"7212148c95947b0fdfcb0c8e37d4357287bdb4bd","user":{"login":"python","id":1525981,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MjU5ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1525981?v=4","gravatar_id":"","url":"https://api.github.com/users/python","html_url":"https://github.com/python","followers_url":"https://api.github.com/users/python/followers","following_url":"https://api.github.com/users/python/following{/other_user}","gists_url":"https://api.github.com/users/python/gists{/gist_id}","starred_url":"https://api.github.com/users/python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python/subscriptions","organizations_url":"https://api.github.com/users/python/orgs","repos_url":"https://api.github.com/users/python/repos","events_url":"https://api.github.com/users/python/events{/privacy}","received_events_url":"https://api.github.com/users/python/received_events","type":"Organization","site_admin":false},"repo":{"id":81598961,"node_id":"MDEwOlJlcG9zaXRvcnk4MTU5ODk2MQ==","name":"cpython","full_name":"python/cpython","private":false,"owner":{"login":"python","id":1525981,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MjU5ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/1525981?v=4","gravatar_id":"","url":"https://api.github.com/users/python","html_url":"https://github.com/python","followers_url":"https://api.github.com/users/python/followers","following_url":"https://api.github.com/users/python/following{/other_user}","gists_url":"https://api.github.com/users/python/gists{/gist_id}","starred_url":"https://api.github.com/users/python/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/python/subscriptions","organizations_url":"https://api.github.com/users/python/orgs","repos_url":"https://api.github.com/users/python/repos","events_url":"https://api.github.com/users/python/events{/privacy}","received_events_url":"https://api.github.com/users/python/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/python/cpython","description":"The Python programming language","fork":false,"url":"https://api.github.com/repos/python/cpython","forks_url":"https://api.github.com/repos/python/cpython/forks","keys_url":"https://api.github.com/repos/python/cpython/keys{/key_id}","collaborators_url":"https://api.github.com/repos/python/cpython/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/python/cpython/teams","hooks_url":"https://api.github.com/repos/python/cpython/hooks","issue_events_url":"https://api.github.com/repos/python/cpython/issues/events{/number}","events_url":"https://api.github.com/repos/python/cpython/events","assignees_url":"https://api.github.com/repos/python/cpython/assignees{/user}","branches_url":"https://api.github.com/repos/python/cpython/branches{/branch}","tags_url":"https://api.github.com/repos/python/cpython/tags","blobs_url":"https://api.github.com/repos/python/cpython/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/python/cpython/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/python/cpython/git/refs{/sha}","trees_url":"https://api.github.com/repos/python/cpython/git/trees{/sha}","statuses_url":"https://api.github.com/repos/python/cpython/statuses/{sha}","languages_url":"https://api.github.com/repos/python/cpython/languages","stargazers_url":"https://api.github.com/repos/python/cpython/stargazers","contributors_url":"https://api.github.com/repos/python/cpython/contributors","subscribers_url":"https://api.github.com/repos/python/cpython/subscribers","subscription_url":"https://api.github.com/repos/python/cpython/subscription","commits_url":"https://api.github.com/repos/python/cpython/commits{/sha}","git_commits_url":"https://api.github.com/repos/python/cpython/git/commits{/sha}","comments_url":"https://api.github.com/repos/python/cpython/comments{/number}","issue_comment_url":"https://api.github.com/repos/python/cpython/issues/comments{/number}","contents_url":"https://api.github.com/repos/python/cpython/contents/{+path}","compare_url":"https://api.github.com/repos/python/cpython/compare/{base}...{head}","merges_url":"https://api.github.com/repos/python/cpython/merges","archive_url":"https://api.github.com/repos/python/cpython/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/python/cpython/downloads","issues_url":"https://api.github.com/repos/python/cpython/issues{/number}","pulls_url":"https://api.github.com/repos/python/cpython/pulls{/number}","milestones_url":"https://api.github.com/repos/python/cpython/milestones{/number}","notifications_url":"https://api.github.com/repos/python/cpython/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/python/cpython/labels{/name}","releases_url":"https://api.github.com/repos/python/cpython/releases{/id}","deployments_url":"https://api.github.com/repos/python/cpython/deployments","created_at":"2017-02-10T19:23:51Z","updated_at":"2018-12-02T20:35:57Z","pushed_at":"2018-12-02T20:43:08Z","git_url":"git://github.com/python/cpython.git","ssh_url":"git@github.com:python/cpython.git","clone_url":"https://github.com/python/cpython.git","svn_url":"https://github.com/python/cpython","homepage":"https://www.python.org/","size":260195,"stargazers_count":21147,"watchers_count":21147,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":7819,"mirror_url":null,"archived":false,"open_issues_count":937,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":7819,"open_issues":937,"watchers":21147,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/python/cpython/pulls/10555"},"html":{"href":"https://github.com/python/cpython/pull/10555"},"issue":{"href":"https://api.github.com/repos/python/cpython/issues/10555"},"comments":{"href":"https://api.github.com/repos/python/cpython/issues/10555/comments"},"review_comments":{"href":"https://api.github.com/repos/python/cpython/pulls/10555/comments"},"review_comment":{"href":"https://api.github.com/repos/python/cpython/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/python/cpython/pulls/10555/commits"},"statuses":{"href":"https://api.github.com/repos/python/cpython/statuses/d807f864c51e82a36e94a76e142affeef89db281"}},"author_association":"NONE"}}
{"actor":{"display_login":"cjw296"}}