{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest-asyncio/issues/93","repository_url":"https://api.github.com/repos/pytest-dev/pytest-asyncio","labels_url":"https://api.github.com/repos/pytest-dev/pytest-asyncio/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest-asyncio/issues/93/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest-asyncio/issues/93/events","html_url":"https://github.com/pytest-dev/pytest-asyncio/issues/93","id":354511454,"node_id":"MDU6SXNzdWUzNTQ1MTE0NTQ=","number":93,"title":"Support for hypothesis in async methods","user":{"login":"carver","id":205327,"node_id":"MDQ6VXNlcjIwNTMyNw==","avatar_url":"https://avatars0.githubusercontent.com/u/205327?v=4","gravatar_id":"","url":"https://api.github.com/users/carver","html_url":"https://github.com/carver","followers_url":"https://api.github.com/users/carver/followers","following_url":"https://api.github.com/users/carver/following{/other_user}","gists_url":"https://api.github.com/users/carver/gists{/gist_id}","starred_url":"https://api.github.com/users/carver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carver/subscriptions","organizations_url":"https://api.github.com/users/carver/orgs","repos_url":"https://api.github.com/users/carver/repos","events_url":"https://api.github.com/users/carver/events{/privacy}","received_events_url":"https://api.github.com/users/carver/received_events","type":"User","site_admin":false},"labels":[{"id":198250610,"node_id":"MDU6TGFiZWwxOTgyNTA2MTA=","url":"https://api.github.com/repos/pytest-dev/pytest-asyncio/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"Zac-HD","id":12229877,"node_id":"MDQ6VXNlcjEyMjI5ODc3","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},"assignees":[{"login":"Zac-HD","id":12229877,"node_id":"MDQ6VXNlcjEyMjI5ODc3","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}],"milestone":null,"comments":13,"created_at":"2018-08-27T23:13:38Z","updated_at":"2018-12-14T03:03:33Z","closed_at":null,"author_association":"NONE","body":"`hypothesis` exits early when used on pytest-asyncio tests, complaining that the test returns a coroutine instead of None. This issue talks about how trio added support for hypothesis: https://github.com/HypothesisWorks/hypothesis/issues/968\r\n\r\nI can work around this with a decorator:\r\n\r\n```py\r\ndef run_in_event_loop(async_func):\r\n    @functools.wraps(async_func)\r\n    def wrapped(operations, queue_size, add_size, get_size, event_loop):\r\n        event_loop.run_until_complete(asyncio.ensure_future(\r\n            async_func(operations, queue_size, add_size, get_size, event_loop),\r\n            loop=event_loop,\r\n        ))\r\n    return wrapped\r\n\r\n@hypothesis.given(...)\r\n@run_in_event_loop\r\n@pytest.mark.asyncio\r\nasync def test_...\r\n```\r\n\r\nBut it looks like the recommended approach is to tinker with the hypothesis attribute added to the test, like: https://github.com/python-trio/pytest-trio/pull/44/files#diff-aacce3c1178656a02aecc59c94209433R231\r\n\r\nIs this something pytest-asyncio is interested in supporting?"},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest-asyncio/issues/comments/447197808","html_url":"https://github.com/pytest-dev/pytest-asyncio/issues/93#issuecomment-447197808","issue_url":"https://api.github.com/repos/pytest-dev/pytest-asyncio/issues/93","id":447197808,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzE5NzgwOA==","user":{"login":"japrogramer","id":1387859,"node_id":"MDQ6VXNlcjEzODc4NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/1387859?v=4","gravatar_id":"","url":"https://api.github.com/users/japrogramer","html_url":"https://github.com/japrogramer","followers_url":"https://api.github.com/users/japrogramer/followers","following_url":"https://api.github.com/users/japrogramer/following{/other_user}","gists_url":"https://api.github.com/users/japrogramer/gists{/gist_id}","starred_url":"https://api.github.com/users/japrogramer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/japrogramer/subscriptions","organizations_url":"https://api.github.com/users/japrogramer/orgs","repos_url":"https://api.github.com/users/japrogramer/repos","events_url":"https://api.github.com/users/japrogramer/events{/privacy}","received_events_url":"https://api.github.com/users/japrogramer/received_events","type":"User","site_admin":false},"created_at":"2018-12-14T03:03:33Z","updated_at":"2018-12-14T03:03:33Z","author_association":"NONE","body":"thats weird i uninstalled and git reset --hard to be on master again\r\nand i have the same errror\r\n```\r\n▶ pip uninstall pytest_asyncio                                                                                                                                                                               ∞\r\nUninstalling pytest-asyncio-0.10.0.dev0:\r\n  Would remove:\r\n    /home/archangel/VENV/pytest/lib/python3.7/site-packages/pytest-asyncio.egg-link\r\nProceed (y/n)? y\r\n  Successfully uninstalled pytest-asyncio-0.10.0.dev0\r\n(pytest)\r\nVENV/pytest/pytest-asyncio  master ✔                                                                                                                                                                          72d\r\n▶ pip install -e .                                                                                                                                                                                           ∞\r\nObtaining file:///home/archangel/VENV/pytest/pytest-asyncio\r\nRequirement already satisfied: pytest>=3.0.6 in /home/archangel/VENV/pytest/lib/python3.7/site-packages (from pytest-asyncio==0.10.0.dev0) (4.0.1)\r\nRequirement already satisfied: pluggy>=0.7 in /home/archangel/VENV/pytest/lib/python3.7/site-packages (from pytest>=3.0.6->pytest-asyncio==0.10.0.dev0) (0.8.0)\r\nRequirement already satisfied: attrs>=17.4.0 in /home/archangel/VENV/pytest/lib/python3.7/site-packages (from pytest>=3.0.6->pytest-asyncio==0.10.0.dev0) (18.2.0)\r\nRequirement already satisfied: more-itertools>=4.0.0 in /home/archangel/VENV/pytest/lib/python3.7/site-packages (from pytest>=3.0.6->pytest-asyncio==0.10.0.dev0) (4.3.0)\r\nRequirement already satisfied: atomicwrites>=1.0 in /home/archangel/VENV/pytest/lib/python3.7/site-packages (from pytest>=3.0.6->pytest-asyncio==0.10.0.dev0) (1.2.1)\r\nRequirement already satisfied: six>=1.10.0 in /home/archangel/VENV/pytest/lib/python3.7/site-packages (from pytest>=3.0.6->pytest-asyncio==0.10.0.dev0) (1.12.0)\r\nRequirement already satisfied: setuptools in /home/archangel/VENV/pytest/lib/python3.7/site-packages (from pytest>=3.0.6->pytest-asyncio==0.10.0.dev0) (39.0.1)\r\nRequirement already satisfied: py>=1.5.0 in /home/archangel/VENV/pytest/lib/python3.7/site-packages (from pytest>=3.0.6->pytest-asyncio==0.10.0.dev0) (1.7.0)\r\nInstalling collected packages: pytest-asyncio\r\n  Running setup.py develop for pytest-asyncio\r\nSuccessfully installed pytest-asyncio\r\n(pytest)\r\nVENV/pytest/pytest-asyncio  master ✔                                                                                                                                                                          72d\r\n▶ coverage run -m pytest                                                                                                                                                                                     ∞\r\n=============================================================================================== test session starts ================================================================================================\r\nplatform linux -- Python 3.7.1, pytest-4.0.1, py-1.7.0, pluggy-0.8.0\r\nhypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/archangel/VENV/pytest/pytest-asyncio/.hypothesis/examples')\r\nrootdir: /home/archangel/VENV/pytest/pytest-asyncio, inifile: setup.cfg\r\nplugins: asyncio-0.10.0.dev0, hypothesis-3.83.0\r\ncollected 34 items\r\n\r\ntests/test_dependent_fixtures.py .                                                                                                                                                                           [  2%]\r\ntests/test_event_loop_scope_35.py ...                                                                                                                                                                        [ 11%]\r\ntests/test_simple.py ..x......                                                                                                                                                                               [ 38%]\r\ntests/test_simple_35.py ......                                                                                                                                                                               [ 55%]\r\ntests/test_subprocess.py ..                                                                                                                                                                                  [ 61%]\r\ntests/async_fixtures/test_async_fixtures_35.py .                                                                                                                                                             [ 64%]\r\ntests/async_fixtures/test_async_fixtures_scope.py .                                                                                                                                                          [ 67%]\r\ntests/async_fixtures/test_async_gen_fixtures_35.py ..                                                                                                                                                        [ 73%]\r\ntests/async_fixtures/test_async_gen_fixtures_36.py ..                                                                                                                                                        [ 79%]\r\ntests/async_fixtures/test_coroutine_fixtures.py s                                                                                                                                                            [ 82%]\r\ntests/async_fixtures/test_nested_36.py .                                                                                                                                                                     [ 85%]\r\ntests/markers/test_class_marker_35.py .                                                                                                                                                                      [ 88%]\r\ntests/markers/test_module_marker_35.py ..                                                                                                                                                                    [ 94%]\r\ntests/multiloop/test_alternative_loops.py ..                                                                                                                                                                 [100%]\r\nException ignored in: <function BaseEventLoop.__del__ at 0x7f6cdb9ad620>\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python3.7/asyncio/base_events.py\", line 612, in __del__\r\n    source=self)\r\nResourceWarning: unclosed event loop <_UnixSelectorEventLoop running=False closed=False debug=False>\r\nException ignored in: <socket.socket fd=10, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>\r\nResourceWarning: unclosed <socket.socket fd=10, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>\r\nException ignored in: <socket.socket fd=11, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>\r\nResourceWarning: unclosed <socket.socket fd=11, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0>\r\n============================================================================================= short test summary info ==============================================================================================\r\nSKIP [1] tests/async_fixtures/test_coroutine_fixtures.py:23: @asyncio.coroutine fixtures are not supported yet\r\nXFAIL tests/test_simple.py::test_asyncio_marker_fail\r\n  need a failure\r\n\r\n================================================================================= 32 passed, 1 skipped, 1 xfailed in 1.22 seconds ==================================================================================\r\n\r\n\r\n```"}}
{"actor":{"display_login":"japrogramer"}}