{"action":"opened","issue":{"url":"https://api.github.com/repos/python-trio/trio/issues/210","repository_url":"https://api.github.com/repos/python-trio/trio","labels_url":"https://api.github.com/repos/python-trio/trio/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/python-trio/trio/issues/210/comments","events_url":"https://api.github.com/repos/python-trio/trio/issues/210/events","html_url":"https://github.com/python-trio/trio/issues/210","id":235310584,"number":210,"title":"test_ssl is very spammy","user":{"login":"buhman","id":728108,"avatar_url":"https://avatars3.githubusercontent.com/u/728108?v=3","gravatar_id":"","url":"https://api.github.com/users/buhman","html_url":"https://github.com/buhman","followers_url":"https://api.github.com/users/buhman/followers","following_url":"https://api.github.com/users/buhman/following{/other_user}","gists_url":"https://api.github.com/users/buhman/gists{/gist_id}","starred_url":"https://api.github.com/users/buhman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buhman/subscriptions","organizations_url":"https://api.github.com/users/buhman/orgs","repos_url":"https://api.github.com/users/buhman/repos","events_url":"https://api.github.com/users/buhman/events{/privacy}","received_events_url":"https://api.github.com/users/buhman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-12T17:48:21Z","updated_at":"2017-06-12T17:48:21Z","closed_at":null,"body":"But it might still be useful to see that output if the test fails.\r\n\r\nI played with pytest-catchlog, and while it does way more than we need (making assertions about the log messages emitted by the code being tested), the actual part where it captures the log messages seems ok:\r\n\r\n```python\r\nimport logging\r\n\r\nimport pytest\r\n\r\n\r\n@pytest.fixture\r\ndef log(request):\r\n    return logging.getLogger(request.node.name)\r\n\r\n\r\ndef fake_thing():\r\n    # imagine this being inside a module instead\r\n    log = logging.getLogger('definitely_trio')\r\n    log.debug('log some stuff…')\r\n\r\n\r\ndef test_raises(log):\r\n    fake_thing()\r\n    log.debug('before raise')\r\n    raise RuntimeError('test')\r\n\r\n\r\ndef test_noraise(log):\r\n    fake_thing()\r\n    log.debug('can\\'t see me')\r\n```\r\n\r\n```python\r\nTest session starts (platform: linux, Python 3.6.1, pytest 3.1.1, pytest-sugar 0.8.0)\r\nrootdir: /home/zack, inifile:\r\nplugins: sugar-0.8.0, cov-2.5.1, catchlog-1.2.2\r\n\r\n――――――――――――――――――――――――――――――――――― test_raises ――――――――――――――――――――――――――――――――――――\r\n\r\nlog = <Logger test_raises (WARNING)>\r\n\r\n    def test_raises(log):\r\n        fake_thing()\r\n        log.debug('before raise')\r\n>       raise RuntimeError('test')\r\nE       RuntimeError: test\r\n\r\ntests/test_foo.py:20: RuntimeError\r\n-------------------------------- Captured log call ---------------------------------\r\ntest_foo.py                 14 DEBUG    log some stuff…\r\ntest_foo.py                 19 DEBUG    before raise\r\n\r\n tests/test_foo.py ⨯✓                                                100% ██████████\r\n============================= short test summary info ==============================\r\nFAIL tests/test_foo.py::test_raises\r\n\r\nResults (0.03s):\r\n       1 passed\r\n       1 failed\r\n         - tests/test_foo.py:17 test_raises\r\n```"}}
{"actor":{"display_login":"buhman"}}