-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for "exception message"-only property for pytest_runtest_logreport #3343
Comments
Would it make sense to have the exception object instead? That way you can get the exception message anyway. Fancy trying to create a patch to do this? |
Would something like this work? |
for a correct solution you would need into pytest_makrereport, and transfer the new metadata to a report section or a set of report section |
Can we close this in favor of #3399? It boils down to improve the report object to contain more information, keeping in mind that this needs to be transferred over the wire by xdist. |
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 inreport
instance forpytest_runtest_logreport
doesn't contain such a property. Insteadreport.longreprtext
has to be used (which includes the full stack trace) to extract just the error line:This doesn't seem to be very stable and might break if pytest changes the formatting.
So it would be great if there could be a property like
report.exc_message
which would hold only the assertion message.The text was updated successfully, but these errors were encountered: