{"action":"opened","number":8,"pull_request":{"url":"https://api.github.com/repos/facebookincubator/TestSlide/pulls/8","id":222186575,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyMTg2NTc1","html_url":"https://github.com/facebookincubator/TestSlide/pull/8","diff_url":"https://github.com/facebookincubator/TestSlide/pull/8.diff","patch_url":"https://github.com/facebookincubator/TestSlide/pull/8.patch","issue_url":"https://api.github.com/repos/facebookincubator/TestSlide/issues/8","number":8,"state":"open","locked":false,"title":"Allow mock_callable() to work with async functions","user":{"login":"fornellas","id":1386232,"node_id":"MDQ6VXNlcjEzODYyMzI=","avatar_url":"https://avatars0.githubusercontent.com/u/1386232?v=4","gravatar_id":"","url":"https://api.github.com/users/fornellas","html_url":"https://github.com/fornellas","followers_url":"https://api.github.com/users/fornellas/followers","following_url":"https://api.github.com/users/fornellas/following{/other_user}","gists_url":"https://api.github.com/users/fornellas/gists{/gist_id}","starred_url":"https://api.github.com/users/fornellas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fornellas/subscriptions","organizations_url":"https://api.github.com/users/fornellas/orgs","repos_url":"https://api.github.com/users/fornellas/repos","events_url":"https://api.github.com/users/fornellas/events{/privacy}","received_events_url":"https://api.github.com/users/fornellas/received_events","type":"User","site_admin":false},"body":"Add support for mock_callable() to wok on async methods:\r\n\r\n```python\r\nimport testslide, asyncio, inspect\r\n\r\nclass Test(object):\r\n  @classmethod\r\n  async def m(self):\r\n    return 'original'\r\n\r\nclass TestAsync(testslide.TestCase):\r\n  def test_async(self):\r\n    self.assertEqual(\r\n      asyncio.run(Test.m()),\r\n      'original'\r\n    )\r\n\r\n    self.mock_callable(Test, 'm')\\\r\n      .to_return_value('mock')\r\n    \r\n    self.assertEqual(\r\n      asyncio.run(Test.m()),\r\n      'mock'\r\n    )\r\n```\r\n\r\nIn principle, this should work for all cases (functions, instance methods, class methods etc), but we need to add test coverage.\r\n\r\nThings to consider:\r\n\r\n- with_implementation and with_wrapper should ideally also accept async methods as arguments.\r\n- to_call_original might be broken for async, we need a test there.","created_at":"2018-10-11T15:40:32Z","updated_at":"2018-10-11T15:40:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/facebookincubator/TestSlide/pulls/8/commits","review_comments_url":"https://api.github.com/repos/facebookincubator/TestSlide/pulls/8/comments","review_comment_url":"https://api.github.com/repos/facebookincubator/TestSlide/pulls/comments{/number}","comments_url":"https://api.github.com/repos/facebookincubator/TestSlide/issues/8/comments","statuses_url":"https://api.github.com/repos/facebookincubator/TestSlide/statuses/e157bbf06c4ff0c6ed9264f00e3610665c395196","head":{"label":"facebookincubator:async_mc","ref":"async_mc","sha":"e157bbf06c4ff0c6ed9264f00e3610665c395196","user":{"login":"facebookincubator","id":19538647,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTM4NjQ3","avatar_url":"https://avatars2.githubusercontent.com/u/19538647?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookincubator","html_url":"https://github.com/facebookincubator","followers_url":"https://api.github.com/users/facebookincubator/followers","following_url":"https://api.github.com/users/facebookincubator/following{/other_user}","gists_url":"https://api.github.com/users/facebookincubator/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookincubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookincubator/subscriptions","organizations_url":"https://api.github.com/users/facebookincubator/orgs","repos_url":"https://api.github.com/users/facebookincubator/repos","events_url":"https://api.github.com/users/facebookincubator/events{/privacy}","received_events_url":"https://api.github.com/users/facebookincubator/received_events","type":"Organization","site_admin":false},"repo":{"id":143481189,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM0ODExODk=","name":"TestSlide","full_name":"facebookincubator/TestSlide","private":false,"owner":{"login":"facebookincubator","id":19538647,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTM4NjQ3","avatar_url":"https://avatars2.githubusercontent.com/u/19538647?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookincubator","html_url":"https://github.com/facebookincubator","followers_url":"https://api.github.com/users/facebookincubator/followers","following_url":"https://api.github.com/users/facebookincubator/following{/other_user}","gists_url":"https://api.github.com/users/facebookincubator/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookincubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookincubator/subscriptions","organizations_url":"https://api.github.com/users/facebookincubator/orgs","repos_url":"https://api.github.com/users/facebookincubator/repos","events_url":"https://api.github.com/users/facebookincubator/events{/privacy}","received_events_url":"https://api.github.com/users/facebookincubator/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/facebookincubator/TestSlide","description":"A Python test framework","fork":false,"url":"https://api.github.com/repos/facebookincubator/TestSlide","forks_url":"https://api.github.com/repos/facebookincubator/TestSlide/forks","keys_url":"https://api.github.com/repos/facebookincubator/TestSlide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebookincubator/TestSlide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebookincubator/TestSlide/teams","hooks_url":"https://api.github.com/repos/facebookincubator/TestSlide/hooks","issue_events_url":"https://api.github.com/repos/facebookincubator/TestSlide/issues/events{/number}","events_url":"https://api.github.com/repos/facebookincubator/TestSlide/events","assignees_url":"https://api.github.com/repos/facebookincubator/TestSlide/assignees{/user}","branches_url":"https://api.github.com/repos/facebookincubator/TestSlide/branches{/branch}","tags_url":"https://api.github.com/repos/facebookincubator/TestSlide/tags","blobs_url":"https://api.github.com/repos/facebookincubator/TestSlide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebookincubator/TestSlide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebookincubator/TestSlide/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebookincubator/TestSlide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebookincubator/TestSlide/statuses/{sha}","languages_url":"https://api.github.com/repos/facebookincubator/TestSlide/languages","stargazers_url":"https://api.github.com/repos/facebookincubator/TestSlide/stargazers","contributors_url":"https://api.github.com/repos/facebookincubator/TestSlide/contributors","subscribers_url":"https://api.github.com/repos/facebookincubator/TestSlide/subscribers","subscription_url":"https://api.github.com/repos/facebookincubator/TestSlide/subscription","commits_url":"https://api.github.com/repos/facebookincubator/TestSlide/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebookincubator/TestSlide/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebookincubator/TestSlide/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebookincubator/TestSlide/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebookincubator/TestSlide/contents/{+path}","compare_url":"https://api.github.com/repos/facebookincubator/TestSlide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebookincubator/TestSlide/merges","archive_url":"https://api.github.com/repos/facebookincubator/TestSlide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebookincubator/TestSlide/downloads","issues_url":"https://api.github.com/repos/facebookincubator/TestSlide/issues{/number}","pulls_url":"https://api.github.com/repos/facebookincubator/TestSlide/pulls{/number}","milestones_url":"https://api.github.com/repos/facebookincubator/TestSlide/milestones{/number}","notifications_url":"https://api.github.com/repos/facebookincubator/TestSlide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebookincubator/TestSlide/labels{/name}","releases_url":"https://api.github.com/repos/facebookincubator/TestSlide/releases{/id}","deployments_url":"https://api.github.com/repos/facebookincubator/TestSlide/deployments","created_at":"2018-08-03T23:13:37Z","updated_at":"2018-10-03T14:59:27Z","pushed_at":"2018-10-11T15:32:11Z","git_url":"git://github.com/facebookincubator/TestSlide.git","ssh_url":"git@github.com:facebookincubator/TestSlide.git","clone_url":"https://github.com/facebookincubator/TestSlide.git","svn_url":"https://github.com/facebookincubator/TestSlide","homepage":null,"size":277,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":8,"watchers":7,"default_branch":"master"}},"base":{"label":"facebookincubator:master","ref":"master","sha":"f7a68a73da17b07dbdb8d2ed8331534502ef5a17","user":{"login":"facebookincubator","id":19538647,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTM4NjQ3","avatar_url":"https://avatars2.githubusercontent.com/u/19538647?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookincubator","html_url":"https://github.com/facebookincubator","followers_url":"https://api.github.com/users/facebookincubator/followers","following_url":"https://api.github.com/users/facebookincubator/following{/other_user}","gists_url":"https://api.github.com/users/facebookincubator/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookincubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookincubator/subscriptions","organizations_url":"https://api.github.com/users/facebookincubator/orgs","repos_url":"https://api.github.com/users/facebookincubator/repos","events_url":"https://api.github.com/users/facebookincubator/events{/privacy}","received_events_url":"https://api.github.com/users/facebookincubator/received_events","type":"Organization","site_admin":false},"repo":{"id":143481189,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM0ODExODk=","name":"TestSlide","full_name":"facebookincubator/TestSlide","private":false,"owner":{"login":"facebookincubator","id":19538647,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5NTM4NjQ3","avatar_url":"https://avatars2.githubusercontent.com/u/19538647?v=4","gravatar_id":"","url":"https://api.github.com/users/facebookincubator","html_url":"https://github.com/facebookincubator","followers_url":"https://api.github.com/users/facebookincubator/followers","following_url":"https://api.github.com/users/facebookincubator/following{/other_user}","gists_url":"https://api.github.com/users/facebookincubator/gists{/gist_id}","starred_url":"https://api.github.com/users/facebookincubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/facebookincubator/subscriptions","organizations_url":"https://api.github.com/users/facebookincubator/orgs","repos_url":"https://api.github.com/users/facebookincubator/repos","events_url":"https://api.github.com/users/facebookincubator/events{/privacy}","received_events_url":"https://api.github.com/users/facebookincubator/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/facebookincubator/TestSlide","description":"A Python test framework","fork":false,"url":"https://api.github.com/repos/facebookincubator/TestSlide","forks_url":"https://api.github.com/repos/facebookincubator/TestSlide/forks","keys_url":"https://api.github.com/repos/facebookincubator/TestSlide/keys{/key_id}","collaborators_url":"https://api.github.com/repos/facebookincubator/TestSlide/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/facebookincubator/TestSlide/teams","hooks_url":"https://api.github.com/repos/facebookincubator/TestSlide/hooks","issue_events_url":"https://api.github.com/repos/facebookincubator/TestSlide/issues/events{/number}","events_url":"https://api.github.com/repos/facebookincubator/TestSlide/events","assignees_url":"https://api.github.com/repos/facebookincubator/TestSlide/assignees{/user}","branches_url":"https://api.github.com/repos/facebookincubator/TestSlide/branches{/branch}","tags_url":"https://api.github.com/repos/facebookincubator/TestSlide/tags","blobs_url":"https://api.github.com/repos/facebookincubator/TestSlide/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/facebookincubator/TestSlide/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/facebookincubator/TestSlide/git/refs{/sha}","trees_url":"https://api.github.com/repos/facebookincubator/TestSlide/git/trees{/sha}","statuses_url":"https://api.github.com/repos/facebookincubator/TestSlide/statuses/{sha}","languages_url":"https://api.github.com/repos/facebookincubator/TestSlide/languages","stargazers_url":"https://api.github.com/repos/facebookincubator/TestSlide/stargazers","contributors_url":"https://api.github.com/repos/facebookincubator/TestSlide/contributors","subscribers_url":"https://api.github.com/repos/facebookincubator/TestSlide/subscribers","subscription_url":"https://api.github.com/repos/facebookincubator/TestSlide/subscription","commits_url":"https://api.github.com/repos/facebookincubator/TestSlide/commits{/sha}","git_commits_url":"https://api.github.com/repos/facebookincubator/TestSlide/git/commits{/sha}","comments_url":"https://api.github.com/repos/facebookincubator/TestSlide/comments{/number}","issue_comment_url":"https://api.github.com/repos/facebookincubator/TestSlide/issues/comments{/number}","contents_url":"https://api.github.com/repos/facebookincubator/TestSlide/contents/{+path}","compare_url":"https://api.github.com/repos/facebookincubator/TestSlide/compare/{base}...{head}","merges_url":"https://api.github.com/repos/facebookincubator/TestSlide/merges","archive_url":"https://api.github.com/repos/facebookincubator/TestSlide/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/facebookincubator/TestSlide/downloads","issues_url":"https://api.github.com/repos/facebookincubator/TestSlide/issues{/number}","pulls_url":"https://api.github.com/repos/facebookincubator/TestSlide/pulls{/number}","milestones_url":"https://api.github.com/repos/facebookincubator/TestSlide/milestones{/number}","notifications_url":"https://api.github.com/repos/facebookincubator/TestSlide/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/facebookincubator/TestSlide/labels{/name}","releases_url":"https://api.github.com/repos/facebookincubator/TestSlide/releases{/id}","deployments_url":"https://api.github.com/repos/facebookincubator/TestSlide/deployments","created_at":"2018-08-03T23:13:37Z","updated_at":"2018-10-03T14:59:27Z","pushed_at":"2018-10-11T15:32:11Z","git_url":"git://github.com/facebookincubator/TestSlide.git","ssh_url":"git@github.com:facebookincubator/TestSlide.git","clone_url":"https://github.com/facebookincubator/TestSlide.git","svn_url":"https://github.com/facebookincubator/TestSlide","homepage":null,"size":277,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":8,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/facebookincubator/TestSlide/pulls/8"},"html":{"href":"https://github.com/facebookincubator/TestSlide/pull/8"},"issue":{"href":"https://api.github.com/repos/facebookincubator/TestSlide/issues/8"},"comments":{"href":"https://api.github.com/repos/facebookincubator/TestSlide/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/facebookincubator/TestSlide/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/facebookincubator/TestSlide/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/facebookincubator/TestSlide/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/facebookincubator/TestSlide/statuses/e157bbf06c4ff0c6ed9264f00e3610665c395196"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":13,"deletions":1,"changed_files":1}}
{"actor":{"display_login":"fornellas"}}