-
Notifications
You must be signed in to change notification settings - Fork 259
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
How to get exception from test in TestCleanup? #293
Comments
@VanKrock : Currently there is no way to get additional information about the error. If we have enough asks for this feature, we will surely address this in our future releases. |
I'll pile onto this one. You seem to always have to give something up depending on which workaround you pursue. There is a stackoverflow about this in which one answer suggests to subscribe to FirstChanceException, but being static, you're risking things getting screwed up when using parallel test execution. That same stackoverflow has a MSTest V2 suggestion to use a TestMethodAttribute extension, which is better, but then as noted in another issue for V2, you don't have access to TestContext. Can we not have our cake and eat it too? Please? |
+1 on this ask. We want to capture the exception in TestCleanup via the logging infra that is being used to capture the rest of the tracing. Currently our log files miss this last piece of information. |
We can get UnitTestOutcome.Error from TestContext.CurrentTestOutcome in TestCleanup. How to get additional information about error? May be Exception? It's can be important for cleanup.
The text was updated successfully, but these errors were encountered: