{"action":"created","comment":{"url":"https://api.github.com/repos/hadley/testthat/pulls/comments/55379477","id":55379477,"diff_hunk":"@@ -41,8 +41,17 @@ get_reporter <- function() {\n with_reporter <- function(reporter, code, start_end_reporter = TRUE) {\n   reporter <- find_reporter(reporter)\n \n-  old <- set_reporter(reporter)\n-  on.exit(set_reporter(old), add = TRUE)\n+  if (!is.null(reporter)) {","path":"R/reporter-zzz.R","position":6,"original_position":6,"commit_id":"5a67b75cea6b8817a642937ab2f3f55419c20585","original_commit_id":"5a67b75cea6b8817a642937ab2f3f55419c20585","user":{"login":"krlmlr","id":1741643,"avatar_url":"https://avatars.githubusercontent.com/u/1741643?v=3","gravatar_id":"","url":"https://api.github.com/users/krlmlr","html_url":"https://github.com/krlmlr","followers_url":"https://api.github.com/users/krlmlr/followers","following_url":"https://api.github.com/users/krlmlr/following{/other_user}","gists_url":"https://api.github.com/users/krlmlr/gists{/gist_id}","starred_url":"https://api.github.com/users/krlmlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krlmlr/subscriptions","organizations_url":"https://api.github.com/users/krlmlr/orgs","repos_url":"https://api.github.com/users/krlmlr/repos","events_url":"https://api.github.com/users/krlmlr/events{/privacy}","received_events_url":"https://api.github.com/users/krlmlr/received_events","type":"User","site_admin":false},"body":"Alternative implementation:\r\n\r\n```\r\nfind_reporter <- function(reporter, use_current = FALSE) {\r\n  if (is.null(reporter)) {\r\n    if (use_current) return(get_reporter()) else return(NULL)\r\n  }\r\n  ...\r\n}\r\n```\r\n","created_at":"2016-03-08T15:57:19Z","updated_at":"2016-03-08T15:57:19Z","html_url":"https://github.com/hadley/testthat/pull/404#discussion_r55379477","pull_request_url":"https://api.github.com/repos/hadley/testthat/pulls/404","_links":{"self":{"href":"https://api.github.com/repos/hadley/testthat/pulls/comments/55379477"},"html":{"href":"https://github.com/hadley/testthat/pull/404#discussion_r55379477"},"pull_request":{"href":"https://api.github.com/repos/hadley/testthat/pulls/404"}}},"pull_request":{"url":"https://api.github.com/repos/hadley/testthat/pulls/404","id":62089717,"html_url":"https://github.com/hadley/testthat/pull/404","diff_url":"https://github.com/hadley/testthat/pull/404.diff","patch_url":"https://github.com/hadley/testthat/pull/404.patch","issue_url":"https://api.github.com/repos/hadley/testthat/issues/404","number":404,"state":"open","locked":false,"title":"NULL reporter","user":{"login":"krlmlr","id":1741643,"avatar_url":"https://avatars.githubusercontent.com/u/1741643?v=3","gravatar_id":"","url":"https://api.github.com/users/krlmlr","html_url":"https://github.com/krlmlr","followers_url":"https://api.github.com/users/krlmlr/followers","following_url":"https://api.github.com/users/krlmlr/following{/other_user}","gists_url":"https://api.github.com/users/krlmlr/gists{/gist_id}","starred_url":"https://api.github.com/users/krlmlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krlmlr/subscriptions","organizations_url":"https://api.github.com/users/krlmlr/orgs","repos_url":"https://api.github.com/users/krlmlr/repos","events_url":"https://api.github.com/users/krlmlr/events{/privacy}","received_events_url":"https://api.github.com/users/krlmlr/received_events","type":"User","site_admin":false},"body":"Does nothing in with_reporter(), provided that an active reporter exists.\n\nNeeded for dplyr testing as part of the dtplyr tests.","created_at":"2016-03-08T15:47:27Z","updated_at":"2016-03-08T15:57:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fe96530fc436130bdb349f6553d4e1dbff9e98f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hadley/testthat/pulls/404/commits","review_comments_url":"https://api.github.com/repos/hadley/testthat/pulls/404/comments","review_comment_url":"https://api.github.com/repos/hadley/testthat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hadley/testthat/issues/404/comments","statuses_url":"https://api.github.com/repos/hadley/testthat/statuses/5a67b75cea6b8817a642937ab2f3f55419c20585","head":{"label":"krlmlr:feature/null-reporter","ref":"feature/null-reporter","sha":"5a67b75cea6b8817a642937ab2f3f55419c20585","user":{"login":"krlmlr","id":1741643,"avatar_url":"https://avatars.githubusercontent.com/u/1741643?v=3","gravatar_id":"","url":"https://api.github.com/users/krlmlr","html_url":"https://github.com/krlmlr","followers_url":"https://api.github.com/users/krlmlr/followers","following_url":"https://api.github.com/users/krlmlr/following{/other_user}","gists_url":"https://api.github.com/users/krlmlr/gists{/gist_id}","starred_url":"https://api.github.com/users/krlmlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krlmlr/subscriptions","organizations_url":"https://api.github.com/users/krlmlr/orgs","repos_url":"https://api.github.com/users/krlmlr/repos","events_url":"https://api.github.com/users/krlmlr/events{/privacy}","received_events_url":"https://api.github.com/users/krlmlr/received_events","type":"User","site_admin":false},"repo":{"id":14702362,"name":"testthat","full_name":"krlmlr/testthat","owner":{"login":"krlmlr","id":1741643,"avatar_url":"https://avatars.githubusercontent.com/u/1741643?v=3","gravatar_id":"","url":"https://api.github.com/users/krlmlr","html_url":"https://github.com/krlmlr","followers_url":"https://api.github.com/users/krlmlr/followers","following_url":"https://api.github.com/users/krlmlr/following{/other_user}","gists_url":"https://api.github.com/users/krlmlr/gists{/gist_id}","starred_url":"https://api.github.com/users/krlmlr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/krlmlr/subscriptions","organizations_url":"https://api.github.com/users/krlmlr/orgs","repos_url":"https://api.github.com/users/krlmlr/repos","events_url":"https://api.github.com/users/krlmlr/events{/privacy}","received_events_url":"https://api.github.com/users/krlmlr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/krlmlr/testthat","description":"An R package to make testing fun","fork":true,"url":"https://api.github.com/repos/krlmlr/testthat","forks_url":"https://api.github.com/repos/krlmlr/testthat/forks","keys_url":"https://api.github.com/repos/krlmlr/testthat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/krlmlr/testthat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/krlmlr/testthat/teams","hooks_url":"https://api.github.com/repos/krlmlr/testthat/hooks","issue_events_url":"https://api.github.com/repos/krlmlr/testthat/issues/events{/number}","events_url":"https://api.github.com/repos/krlmlr/testthat/events","assignees_url":"https://api.github.com/repos/krlmlr/testthat/assignees{/user}","branches_url":"https://api.github.com/repos/krlmlr/testthat/branches{/branch}","tags_url":"https://api.github.com/repos/krlmlr/testthat/tags","blobs_url":"https://api.github.com/repos/krlmlr/testthat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/krlmlr/testthat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/krlmlr/testthat/git/refs{/sha}","trees_url":"https://api.github.com/repos/krlmlr/testthat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/krlmlr/testthat/statuses/{sha}","languages_url":"https://api.github.com/repos/krlmlr/testthat/languages","stargazers_url":"https://api.github.com/repos/krlmlr/testthat/stargazers","contributors_url":"https://api.github.com/repos/krlmlr/testthat/contributors","subscribers_url":"https://api.github.com/repos/krlmlr/testthat/subscribers","subscription_url":"https://api.github.com/repos/krlmlr/testthat/subscription","commits_url":"https://api.github.com/repos/krlmlr/testthat/commits{/sha}","git_commits_url":"https://api.github.com/repos/krlmlr/testthat/git/commits{/sha}","comments_url":"https://api.github.com/repos/krlmlr/testthat/comments{/number}","issue_comment_url":"https://api.github.com/repos/krlmlr/testthat/issues/comments{/number}","contents_url":"https://api.github.com/repos/krlmlr/testthat/contents/{+path}","compare_url":"https://api.github.com/repos/krlmlr/testthat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/krlmlr/testthat/merges","archive_url":"https://api.github.com/repos/krlmlr/testthat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/krlmlr/testthat/downloads","issues_url":"https://api.github.com/repos/krlmlr/testthat/issues{/number}","pulls_url":"https://api.github.com/repos/krlmlr/testthat/pulls{/number}","milestones_url":"https://api.github.com/repos/krlmlr/testthat/milestones{/number}","notifications_url":"https://api.github.com/repos/krlmlr/testthat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/krlmlr/testthat/labels{/name}","releases_url":"https://api.github.com/repos/krlmlr/testthat/releases{/id}","deployments_url":"https://api.github.com/repos/krlmlr/testthat/deployments","created_at":"2013-11-26T00:05:55Z","updated_at":"2015-05-03T11:27:04Z","pushed_at":"2016-03-08T15:53:06Z","git_url":"git://github.com/krlmlr/testthat.git","ssh_url":"git@github.com:krlmlr/testthat.git","clone_url":"https://github.com/krlmlr/testthat.git","svn_url":"https://github.com/krlmlr/testthat","homepage":"","size":1677,"stargazers_count":0,"watchers_count":0,"language":"R","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"hadley:master","ref":"master","sha":"4b399687ac2a6fc3f0f427873c03dbadd400b87a","user":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"repo":{"id":295311,"name":"testthat","full_name":"hadley/testthat","owner":{"login":"hadley","id":4196,"avatar_url":"https://avatars.githubusercontent.com/u/4196?v=3","gravatar_id":"","url":"https://api.github.com/users/hadley","html_url":"https://github.com/hadley","followers_url":"https://api.github.com/users/hadley/followers","following_url":"https://api.github.com/users/hadley/following{/other_user}","gists_url":"https://api.github.com/users/hadley/gists{/gist_id}","starred_url":"https://api.github.com/users/hadley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadley/subscriptions","organizations_url":"https://api.github.com/users/hadley/orgs","repos_url":"https://api.github.com/users/hadley/repos","events_url":"https://api.github.com/users/hadley/events{/privacy}","received_events_url":"https://api.github.com/users/hadley/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hadley/testthat","description":"An R package to make testing fun","fork":false,"url":"https://api.github.com/repos/hadley/testthat","forks_url":"https://api.github.com/repos/hadley/testthat/forks","keys_url":"https://api.github.com/repos/hadley/testthat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hadley/testthat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hadley/testthat/teams","hooks_url":"https://api.github.com/repos/hadley/testthat/hooks","issue_events_url":"https://api.github.com/repos/hadley/testthat/issues/events{/number}","events_url":"https://api.github.com/repos/hadley/testthat/events","assignees_url":"https://api.github.com/repos/hadley/testthat/assignees{/user}","branches_url":"https://api.github.com/repos/hadley/testthat/branches{/branch}","tags_url":"https://api.github.com/repos/hadley/testthat/tags","blobs_url":"https://api.github.com/repos/hadley/testthat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hadley/testthat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hadley/testthat/git/refs{/sha}","trees_url":"https://api.github.com/repos/hadley/testthat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hadley/testthat/statuses/{sha}","languages_url":"https://api.github.com/repos/hadley/testthat/languages","stargazers_url":"https://api.github.com/repos/hadley/testthat/stargazers","contributors_url":"https://api.github.com/repos/hadley/testthat/contributors","subscribers_url":"https://api.github.com/repos/hadley/testthat/subscribers","subscription_url":"https://api.github.com/repos/hadley/testthat/subscription","commits_url":"https://api.github.com/repos/hadley/testthat/commits{/sha}","git_commits_url":"https://api.github.com/repos/hadley/testthat/git/commits{/sha}","comments_url":"https://api.github.com/repos/hadley/testthat/comments{/number}","issue_comment_url":"https://api.github.com/repos/hadley/testthat/issues/comments{/number}","contents_url":"https://api.github.com/repos/hadley/testthat/contents/{+path}","compare_url":"https://api.github.com/repos/hadley/testthat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hadley/testthat/merges","archive_url":"https://api.github.com/repos/hadley/testthat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hadley/testthat/downloads","issues_url":"https://api.github.com/repos/hadley/testthat/issues{/number}","pulls_url":"https://api.github.com/repos/hadley/testthat/pulls{/number}","milestones_url":"https://api.github.com/repos/hadley/testthat/milestones{/number}","notifications_url":"https://api.github.com/repos/hadley/testthat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hadley/testthat/labels{/name}","releases_url":"https://api.github.com/repos/hadley/testthat/releases{/id}","deployments_url":"https://api.github.com/repos/hadley/testthat/deployments","created_at":"2009-09-02T12:51:44Z","updated_at":"2016-03-06T20:40:30Z","pushed_at":"2016-03-08T15:53:06Z","git_url":"git://github.com/hadley/testthat.git","ssh_url":"git@github.com:hadley/testthat.git","clone_url":"https://github.com/hadley/testthat.git","svn_url":"https://github.com/hadley/testthat","homepage":"","size":2012,"stargazers_count":298,"watchers_count":298,"language":"R","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":135,"mirror_url":null,"open_issues_count":8,"forks":135,"open_issues":8,"watchers":298,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hadley/testthat/pulls/404"},"html":{"href":"https://github.com/hadley/testthat/pull/404"},"issue":{"href":"https://api.github.com/repos/hadley/testthat/issues/404"},"comments":{"href":"https://api.github.com/repos/hadley/testthat/issues/404/comments"},"review_comments":{"href":"https://api.github.com/repos/hadley/testthat/pulls/404/comments"},"review_comment":{"href":"https://api.github.com/repos/hadley/testthat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hadley/testthat/pulls/404/commits"},"statuses":{"href":"https://api.github.com/repos/hadley/testthat/statuses/5a67b75cea6b8817a642937ab2f3f55419c20585"}}}}