{"action":"created","issue":{"url":"https://api.github.com/repos/nette/tester/issues/238","labels_url":"https://api.github.com/repos/nette/tester/issues/238/labels{/name}","comments_url":"https://api.github.com/repos/nette/tester/issues/238/comments","events_url":"https://api.github.com/repos/nette/tester/issues/238/events","html_url":"https://github.com/nette/tester/pull/238","id":99185598,"number":238,"title":"Exceptions from setUp and tearDown are not subject for @throws annotation","user":{"login":"MartinMystikJonas","id":2094752,"avatar_url":"https://avatars.githubusercontent.com/u/2094752?v=3","gravatar_id":"","url":"https://api.github.com/users/MartinMystikJonas","html_url":"https://github.com/MartinMystikJonas","followers_url":"https://api.github.com/users/MartinMystikJonas/followers","following_url":"https://api.github.com/users/MartinMystikJonas/following{/other_user}","gists_url":"https://api.github.com/users/MartinMystikJonas/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinMystikJonas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinMystikJonas/subscriptions","organizations_url":"https://api.github.com/users/MartinMystikJonas/orgs","repos_url":"https://api.github.com/users/MartinMystikJonas/repos","events_url":"https://api.github.com/users/MartinMystikJonas/events{/privacy}","received_events_url":"https://api.github.com/users/MartinMystikJonas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nette/tester/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-05T11:40:56Z","updated_at":"2015-08-06T22:11:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/nette/tester/pulls/238","html_url":"https://github.com/nette/tester/pull/238","diff_url":"https://github.com/nette/tester/pull/238.diff","patch_url":"https://github.com/nette/tester/pull/238.patch"},"body":"When Exception is thrown from setUp or TearDown it was processed same as when it is thrown from test itself. Combined with @throws annotation this can lead to false positive tests. For example when exception in expected from test but was not thrown due to error byt this error in test also caused throwing od exception from tearDown it passes.\r\n\r\nAlso covers case when exception is thrown both from test and tearDown."},"comment":{"url":"https://api.github.com/repos/nette/tester/issues/comments/128523713","html_url":"https://github.com/nette/tester/pull/238#issuecomment-128523713","issue_url":"https://api.github.com/repos/nette/tester/issues/238","id":128523713,"user":{"login":"MartinMystikJonas","id":2094752,"avatar_url":"https://avatars.githubusercontent.com/u/2094752?v=3","gravatar_id":"","url":"https://api.github.com/users/MartinMystikJonas","html_url":"https://github.com/MartinMystikJonas","followers_url":"https://api.github.com/users/MartinMystikJonas/followers","following_url":"https://api.github.com/users/MartinMystikJonas/following{/other_user}","gists_url":"https://api.github.com/users/MartinMystikJonas/gists{/gist_id}","starred_url":"https://api.github.com/users/MartinMystikJonas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MartinMystikJonas/subscriptions","organizations_url":"https://api.github.com/users/MartinMystikJonas/orgs","repos_url":"https://api.github.com/users/MartinMystikJonas/repos","events_url":"https://api.github.com/users/MartinMystikJonas/events{/privacy}","received_events_url":"https://api.github.com/users/MartinMystikJonas/received_events","type":"User","site_admin":false},"created_at":"2015-08-06T22:11:05Z","updated_at":"2015-08-06T22:11:05Z","body":"You need to see both in case firt exception (from test) is expected (specified by @throws) but second exception from tearDown is not. For example test correctly throws exception byt Mockery checks in tear down fails then. Without seeing both exceptions you will only know that test correctly throws exception but not what failed then in tearDown."}}