{"action":"created","issue":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/3343","repository_url":"https://api.github.com/repos/pytest-dev/pytest","labels_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3343/labels{/name}","comments_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3343/comments","events_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3343/events","html_url":"https://github.com/pytest-dev/pytest/issues/3343","id":308719386,"number":3343,"title":"Support for \"exception message\"-only property for pytest_runtest_logreport","user":{"login":"whimboo","id":129603,"avatar_url":"https://avatars2.githubusercontent.com/u/129603?v=4","gravatar_id":"","url":"https://api.github.com/users/whimboo","html_url":"https://github.com/whimboo","followers_url":"https://api.github.com/users/whimboo/followers","following_url":"https://api.github.com/users/whimboo/following{/other_user}","gists_url":"https://api.github.com/users/whimboo/gists{/gist_id}","starred_url":"https://api.github.com/users/whimboo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whimboo/subscriptions","organizations_url":"https://api.github.com/users/whimboo/orgs","repos_url":"https://api.github.com/users/whimboo/repos","events_url":"https://api.github.com/users/whimboo/events{/privacy}","received_events_url":"https://api.github.com/users/whimboo/received_events","type":"User","site_admin":false},"labels":[{"id":224849195,"url":"https://api.github.com/repos/pytest-dev/pytest/labels/type:%20enhancement","name":"type: enhancement","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-03-26T20:16:00Z","updated_at":"2018-04-02T18:29:56Z","closed_at":null,"author_association":"NONE","body":"We have a custom report class defined which uses the `pytest_runtest_logreport` hook to handle test results, and to build a test report based on our needs. For one of the reports only the exception message is used as summary. Sadly the passed in `report` instance for `pytest_runtest_logreport` doesn't contain such a property. Instead `report.longreprtext` has to be used (which includes the full stack trace) to extract just the error line:\r\n\r\n```\r\nclass SubtestResultRecorder(object):\r\n    def __init__(self):\r\n        self.results = []\r\n\r\n    def pytest_runtest_logreport(self, report):\r\n        if report.failed && report.when != \"call\":\r\n            message = \"\"\r\n            for line in report.longreprtext.splitlines():\r\n                if line.startswith(\"E   \"):\r\n                    message = line[1:].strip()\r\n                    break\r\n                [...]\r\n ```\r\n\r\nThis doesn't seem to be very stable and might break if pytest changes the formatting.\r\n\r\nSo it would be great if there could be a property like `report.exc_message` which would hold only the assertion message."},"comment":{"url":"https://api.github.com/repos/pytest-dev/pytest/issues/comments/378003156","html_url":"https://github.com/pytest-dev/pytest/issues/3343#issuecomment-378003156","issue_url":"https://api.github.com/repos/pytest-dev/pytest/issues/3343","id":378003156,"user":{"login":"brianmaissy","id":622989,"avatar_url":"https://avatars0.githubusercontent.com/u/622989?v=4","gravatar_id":"","url":"https://api.github.com/users/brianmaissy","html_url":"https://github.com/brianmaissy","followers_url":"https://api.github.com/users/brianmaissy/followers","following_url":"https://api.github.com/users/brianmaissy/following{/other_user}","gists_url":"https://api.github.com/users/brianmaissy/gists{/gist_id}","starred_url":"https://api.github.com/users/brianmaissy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianmaissy/subscriptions","organizations_url":"https://api.github.com/users/brianmaissy/orgs","repos_url":"https://api.github.com/users/brianmaissy/repos","events_url":"https://api.github.com/users/brianmaissy/events{/privacy}","received_events_url":"https://api.github.com/users/brianmaissy/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T18:29:56Z","updated_at":"2018-04-02T18:29:56Z","author_association":"CONTRIBUTOR","body":"Would something like this work?"}}
{"actor":{"display_login":"brianmaissy"}}