{"action":"created","comment":{"url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/comments/171240288","pull_request_review_id":100056723,"id":171240288,"diff_hunk":"@@ -998,7 +1038,16 @@ def wrapped_test(*arguments, **kwargs):\n                 return\n \n             try:\n-                state.run()\n+                if isinstance(cls, type) and issubclass(cls, TestCase) and \\\n+                        hasattr(cls, 'subTest'):\n+                    subTest = cls.subTest\n+                    try:\n+                        setattr(cls, 'subTest', fake_subTest)","path":"src/hypothesis/core.py","position":null,"original_position":90,"commit_id":"73271dd94760310db2418d1235a8b4fd06390632","original_commit_id":"d24210503106124b592c56dd79048ca2e49964c0","user":{"login":"Zac-HD","id":12229877,"avatar_url":"https://avatars1.githubusercontent.com/u/12229877?v=4","gravatar_id":"","url":"https://api.github.com/users/Zac-HD","html_url":"https://github.com/Zac-HD","followers_url":"https://api.github.com/users/Zac-HD/followers","following_url":"https://api.github.com/users/Zac-HD/following{/other_user}","gists_url":"https://api.github.com/users/Zac-HD/gists{/gist_id}","starred_url":"https://api.github.com/users/Zac-HD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zac-HD/subscriptions","organizations_url":"https://api.github.com/users/Zac-HD/orgs","repos_url":"https://api.github.com/users/Zac-HD/repos","events_url":"https://api.github.com/users/Zac-HD/events{/privacy}","received_events_url":"https://api.github.com/users/Zac-HD/received_events","type":"User","site_admin":false},"body":"Clarifications: correct on the first point; the problem there was that all the intermediate output is via `unittest`, and Hypothesis knows nothing about it (so \"working as unintended\", I guess).  And correct, `subTest` becomes a no-op so we only get the first failure.\r\n\r\nShowing output for each is probably possible, but sensibly minimising for each subTest is next to impossible - they can be arbitrary code and arbitrary labels, so there's no consistent way to target them.  On this basis I've reverted to my earlier plan of putting a deprecation in the `fake_subTest` - thanks for mentioning that!","created_at":"2018-02-28T13:15:16Z","updated_at":"2018-02-28T13:15:16Z","html_url":"https://github.com/HypothesisWorks/hypothesis-python/pull/1072#discussion_r171240288","pull_request_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/1072","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/comments/171240288"},"html":{"href":"https://github.com/HypothesisWorks/hypothesis-python/pull/1072#discussion_r171240288"},"pull_request":{"href":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/1072"}},"in_reply_to_id":171136504},"pull_request":{"url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/1072","id":162954886,"html_url":"https://github.com/HypothesisWorks/hypothesis-python/pull/1072","diff_url":"https://github.com/HypothesisWorks/hypothesis-python/pull/1072.diff","patch_url":"https://github.com/HypothesisWorks/hypothesis-python/pull/1072.patch","issue_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/issues/1072","number":1072,"state":"open","locked":false,"title":"Improve unhappy paths using @given with unittest","user":{"login":"Zac-HD","id":12229877,"avatar_url":"https://avatars1.githubusercontent.com/u/12229877?v=4","gravatar_id":"","url":"https://api.github.com/users/Zac-HD","html_url":"https://github.com/Zac-HD","followers_url":"https://api.github.com/users/Zac-HD/followers","following_url":"https://api.github.com/users/Zac-HD/following{/other_user}","gists_url":"https://api.github.com/users/Zac-HD/gists{/gist_id}","starred_url":"https://api.github.com/users/Zac-HD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zac-HD/subscriptions","organizations_url":"https://api.github.com/users/Zac-HD/orgs","repos_url":"https://api.github.com/users/Zac-HD/repos","events_url":"https://api.github.com/users/Zac-HD/events{/privacy}","received_events_url":"https://api.github.com/users/Zac-HD/received_events","type":"User","site_admin":false},"body":"- [x] Closes #991 - applying `@given` to setUp, tearDown, etc will all be detected and issue a deprecation.\r\n- [x] Closes #1071 - using `subTest` with a test decorated with `@given` now works, via some introspective monkeypatching\r\n- [x] Closes #1113 - easy to check when you have access to the class.\r\n\r\nThis is implemented via a series of terrible hacks, so I've put the whole thing in `core.py` 😜 ","created_at":"2018-01-15T13:44:20Z","updated_at":"2018-02-28T13:15:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"367e492790b12d9c4e501508617cdc7858fa9c96","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/1072/commits","review_comments_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/1072/comments","review_comment_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/issues/1072/comments","statuses_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/statuses/73271dd94760310db2418d1235a8b4fd06390632","head":{"label":"Zac-HD:subtest-note","ref":"subtest-note","sha":"73271dd94760310db2418d1235a8b4fd06390632","user":{"login":"Zac-HD","id":12229877,"avatar_url":"https://avatars1.githubusercontent.com/u/12229877?v=4","gravatar_id":"","url":"https://api.github.com/users/Zac-HD","html_url":"https://github.com/Zac-HD","followers_url":"https://api.github.com/users/Zac-HD/followers","following_url":"https://api.github.com/users/Zac-HD/following{/other_user}","gists_url":"https://api.github.com/users/Zac-HD/gists{/gist_id}","starred_url":"https://api.github.com/users/Zac-HD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zac-HD/subscriptions","organizations_url":"https://api.github.com/users/Zac-HD/orgs","repos_url":"https://api.github.com/users/Zac-HD/repos","events_url":"https://api.github.com/users/Zac-HD/events{/privacy}","received_events_url":"https://api.github.com/users/Zac-HD/received_events","type":"User","site_admin":false},"repo":{"id":82669519,"name":"hypothesis-python","full_name":"Zac-HD/hypothesis-python","owner":{"login":"Zac-HD","id":12229877,"avatar_url":"https://avatars1.githubusercontent.com/u/12229877?v=4","gravatar_id":"","url":"https://api.github.com/users/Zac-HD","html_url":"https://github.com/Zac-HD","followers_url":"https://api.github.com/users/Zac-HD/followers","following_url":"https://api.github.com/users/Zac-HD/following{/other_user}","gists_url":"https://api.github.com/users/Zac-HD/gists{/gist_id}","starred_url":"https://api.github.com/users/Zac-HD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Zac-HD/subscriptions","organizations_url":"https://api.github.com/users/Zac-HD/orgs","repos_url":"https://api.github.com/users/Zac-HD/repos","events_url":"https://api.github.com/users/Zac-HD/events{/privacy}","received_events_url":"https://api.github.com/users/Zac-HD/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Zac-HD/hypothesis-python","description":"Hypothesis is a powerful, flexible, and easy to use library for property-based testing.","fork":true,"url":"https://api.github.com/repos/Zac-HD/hypothesis-python","forks_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/forks","keys_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/teams","hooks_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/hooks","issue_events_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/issues/events{/number}","events_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/events","assignees_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/assignees{/user}","branches_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/branches{/branch}","tags_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/tags","blobs_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/statuses/{sha}","languages_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/languages","stargazers_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/stargazers","contributors_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/contributors","subscribers_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/subscribers","subscription_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/subscription","commits_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/contents/{+path}","compare_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/merges","archive_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/downloads","issues_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/issues{/number}","pulls_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/pulls{/number}","milestones_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/milestones{/number}","notifications_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/labels{/name}","releases_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/releases{/id}","deployments_url":"https://api.github.com/repos/Zac-HD/hypothesis-python/deployments","created_at":"2017-02-21T10:56:41Z","updated_at":"2018-02-25T12:04:02Z","pushed_at":"2018-02-28T13:09:52Z","git_url":"git://github.com/Zac-HD/hypothesis-python.git","ssh_url":"git@github.com:Zac-HD/hypothesis-python.git","clone_url":"https://github.com/Zac-HD/hypothesis-python.git","svn_url":"https://github.com/Zac-HD/hypothesis-python","homepage":"http://hypothesis.works","size":10204,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"HypothesisWorks:master","ref":"master","sha":"85822af60c93bc855d5bff490494494db8f82cd2","user":{"login":"HypothesisWorks","id":18481919,"avatar_url":"https://avatars1.githubusercontent.com/u/18481919?v=4","gravatar_id":"","url":"https://api.github.com/users/HypothesisWorks","html_url":"https://github.com/HypothesisWorks","followers_url":"https://api.github.com/users/HypothesisWorks/followers","following_url":"https://api.github.com/users/HypothesisWorks/following{/other_user}","gists_url":"https://api.github.com/users/HypothesisWorks/gists{/gist_id}","starred_url":"https://api.github.com/users/HypothesisWorks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HypothesisWorks/subscriptions","organizations_url":"https://api.github.com/users/HypothesisWorks/orgs","repos_url":"https://api.github.com/users/HypothesisWorks/repos","events_url":"https://api.github.com/users/HypothesisWorks/events{/privacy}","received_events_url":"https://api.github.com/users/HypothesisWorks/received_events","type":"Organization","site_admin":false},"repo":{"id":8685799,"name":"hypothesis-python","full_name":"HypothesisWorks/hypothesis-python","owner":{"login":"HypothesisWorks","id":18481919,"avatar_url":"https://avatars1.githubusercontent.com/u/18481919?v=4","gravatar_id":"","url":"https://api.github.com/users/HypothesisWorks","html_url":"https://github.com/HypothesisWorks","followers_url":"https://api.github.com/users/HypothesisWorks/followers","following_url":"https://api.github.com/users/HypothesisWorks/following{/other_user}","gists_url":"https://api.github.com/users/HypothesisWorks/gists{/gist_id}","starred_url":"https://api.github.com/users/HypothesisWorks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HypothesisWorks/subscriptions","organizations_url":"https://api.github.com/users/HypothesisWorks/orgs","repos_url":"https://api.github.com/users/HypothesisWorks/repos","events_url":"https://api.github.com/users/HypothesisWorks/events{/privacy}","received_events_url":"https://api.github.com/users/HypothesisWorks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HypothesisWorks/hypothesis-python","description":"Hypothesis is a powerful, flexible, and easy to use library for property-based testing.","fork":false,"url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python","forks_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/forks","keys_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/teams","hooks_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/hooks","issue_events_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/issues/events{/number}","events_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/events","assignees_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/assignees{/user}","branches_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/branches{/branch}","tags_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/tags","blobs_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/statuses/{sha}","languages_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/languages","stargazers_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/stargazers","contributors_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/contributors","subscribers_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/subscribers","subscription_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/subscription","commits_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/contents/{+path}","compare_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/merges","archive_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/downloads","issues_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/issues{/number}","pulls_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls{/number}","milestones_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/milestones{/number}","notifications_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/labels{/name}","releases_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/releases{/id}","deployments_url":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/deployments","created_at":"2013-03-10T13:51:19Z","updated_at":"2018-02-28T09:50:12Z","pushed_at":"2018-02-28T13:09:54Z","git_url":"git://github.com/HypothesisWorks/hypothesis-python.git","ssh_url":"git@github.com:HypothesisWorks/hypothesis-python.git","clone_url":"https://github.com/HypothesisWorks/hypothesis-python.git","svn_url":"https://github.com/HypothesisWorks/hypothesis-python","homepage":"http://hypothesis.works","size":10325,"stargazers_count":2491,"watchers_count":2491,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":219,"mirror_url":null,"archived":false,"open_issues_count":120,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":219,"open_issues":120,"watchers":2491,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/1072"},"html":{"href":"https://github.com/HypothesisWorks/hypothesis-python/pull/1072"},"issue":{"href":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/issues/1072"},"comments":{"href":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/issues/1072/comments"},"review_comments":{"href":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/1072/comments"},"review_comment":{"href":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/pulls/1072/commits"},"statuses":{"href":"https://api.github.com/repos/HypothesisWorks/hypothesis-python/statuses/73271dd94760310db2418d1235a8b4fd06390632"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"Zac-HD"}}