eat There is no currently active test (#770)
This commit is contained in:
@@ -84,16 +84,32 @@ namespace k8s.Tests.Logging
|
|||||||
throw new ArgumentNullException(nameof(formatter));
|
throw new ArgumentNullException(nameof(formatter));
|
||||||
}
|
}
|
||||||
|
|
||||||
TestOutput.WriteLine(string.Format(
|
try
|
||||||
"[{0}] {1}: {2}",
|
|
||||||
level,
|
|
||||||
LoggerCategory,
|
|
||||||
formatter(state, exception)));
|
|
||||||
|
|
||||||
if (exception != null)
|
|
||||||
{
|
{
|
||||||
TestOutput.WriteLine(
|
TestOutput.WriteLine(string.Format(
|
||||||
exception.ToString());
|
"[{0}] {1}: {2}",
|
||||||
|
level,
|
||||||
|
LoggerCategory,
|
||||||
|
formatter(state, exception)));
|
||||||
|
|
||||||
|
if (exception != null)
|
||||||
|
{
|
||||||
|
TestOutput.WriteLine(
|
||||||
|
exception.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (AggregateException e)
|
||||||
|
{
|
||||||
|
// ignore 'There is no currently active test.'
|
||||||
|
foreach (var inner in e.InnerExceptions)
|
||||||
|
{
|
||||||
|
if (inner.Message.Contains("There is no currently active test"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user