{"action":"created","issue":{"url":"https://api.github.com/repos/HypothesisWorks/hypothesis/issues/377","repository_url":"https://api.github.com/repos/HypothesisWorks/hypothesis","labels_url":"https://api.github.com/repos/HypothesisWorks/hypothesis/issues/377/labels{/name}","comments_url":"https://api.github.com/repos/HypothesisWorks/hypothesis/issues/377/comments","events_url":"https://api.github.com/repos/HypothesisWorks/hypothesis/issues/377/events","html_url":"https://github.com/HypothesisWorks/hypothesis/issues/377","id":183643405,"number":377,"title":"pytest function scoped fixtures should run once per example, not once per test","user":{"login":"DRMacIver","id":28623,"avatar_url":"https://avatars0.githubusercontent.com/u/28623?v=4","gravatar_id":"","url":"https://api.github.com/users/DRMacIver","html_url":"https://github.com/DRMacIver","followers_url":"https://api.github.com/users/DRMacIver/followers","following_url":"https://api.github.com/users/DRMacIver/following{/other_user}","gists_url":"https://api.github.com/users/DRMacIver/gists{/gist_id}","starred_url":"https://api.github.com/users/DRMacIver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DRMacIver/subscriptions","organizations_url":"https://api.github.com/users/DRMacIver/orgs","repos_url":"https://api.github.com/users/DRMacIver/repos","events_url":"https://api.github.com/users/DRMacIver/events{/privacy}","received_events_url":"https://api.github.com/users/DRMacIver/received_events","type":"User","site_admin":false},"labels":[{"id":31355955,"url":"https://api.github.com/repos/HypothesisWorks/hypothesis/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-18T10:08:21Z","updated_at":"2018-04-26T05:35:43Z","closed_at":null,"author_association":"OWNER","body":"Because of the way Hypothesis just exposes a single test function, pytest just runs its fixtures once for that function.\n\nThis is a long running problem with Hypothesis's interaction with pytest and there is [an open bug about it on the pytest side too](https://github.com/pytest-dev/pytest/issues/916).\n\nFixing this is tricky. The [fixtures-integration](https://github.com/HypothesisWorks/hypothesis-python/tree/fixtures-integration) branch has a partial prototype which makes _some_ progress towards making it work, but it's very far from complete and has a number of issues which are likely to need substantial work to fix.\n\nI [am currently seeking funding to work on this ticket](http://hypothesis.works/articles/pytest-integration-sponsorship/) and it is unlikely to make much progress without said funding.\n"},"comment":{"url":"https://api.github.com/repos/HypothesisWorks/hypothesis/issues/comments/384519059","html_url":"https://github.com/HypothesisWorks/hypothesis/issues/377#issuecomment-384519059","issue_url":"https://api.github.com/repos/HypothesisWorks/hypothesis/issues/377","id":384519059,"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},"created_at":"2018-04-26T05:35:43Z","updated_at":"2018-04-26T05:35:43Z","author_association":"MEMBER","body":"Actually... it might be possible to incorporate a version of `pytest-subtesthack` into our pytest plugin, that activates this logic *only* for Hypothesis tests.  @untitaker, do you think this could work?"}}
{"actor":{"display_login":"Zac-HD"}}