An exception in AssemblyCleanup hides test exception
Steps To Reproduce
Run this:
[TestClass]
public sealed class Test1
{
[TestMethod]
public void TestMethod1()
{
Assert.Fail("I want to see this");
}
[AssemblyCleanup]
public static void Shutdown()
{
throw new Exception("... but I only see this");
}
}
Expected behavior
"I want to see this" should be seen in the output
Actual behavior
but this is the only output:
...\MSTestProject1.dll : error TESTERROR:
TestMethod1 (140ms): Fehlermeldung: Fehler bei der Methode "Test1.Shutdown" für die Assemblybereinigung. Fehlermeldung: System.Exception: ... but I only see this. "StackTrace": bei MSTestPro
ject1.Test1.Shutdown() in ...\MSTestProject1\Test1.cs:Zeile 15.
Stapelverfolgung:
bei Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.TestAssemblyInfo.ExecuteAssemblyCleanup() in /_/src/Adapter/MSTest.TestAdapter/Execution/TestAssemblyInfo.cs:Zeile 316.
bei Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Execution.UnitTestRunner.RunAssemblyCleanupIfNeeded(ITestContext testContext, ClassCleanupManager classCleanupManager, TypeCache typ
An exception in
AssemblyCleanuphides test exceptionSteps To Reproduce
Run this:
Expected behavior
"I want to see this" should be seen in the output
Actual behavior
but this is the only output: