-
Notifications
You must be signed in to change notification settings - Fork 731
AssertionScope - allow reportables which are only calculated on failure #1515
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
AssertionScope - allow reportables which are only calculated on failure #1515
Conversation
dennisdoomen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be willing to add the corresponding release note changes and possibly some docs as explained in the Pull Request template?
Absolutely! I've added to the release notes for 6.0.0. Please let me know if I missed anything there. I don't see any reference to the existing |
|
|
||
| private sealed class DeferredReportable | ||
| { | ||
| private readonly Lazy<string> lazyValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a known case where valueFunc is invoked more than once?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're only calling ContextDateItems.GetReportable when the scope is disposed, and only if it's the outer scope, so I think we're fine.
|
You need to update the approval files. |
|
Thank you for your contribution. |
Discussed here - I thought I'd contribute a potential solution.
My personal use case is that I've got some costly calculations to display user-friendly failure info, and I'd like to avoid doing this for the 99% case where the tests run successfully.
IMPORTANT
AcceptApiChanges.ps1/AcceptApiChanges.sh.