eat There is no currently active test (#770)

This commit is contained in:
Boshi Lian
2022-01-26 11:09:35 -08:00
committed by GitHub
parent 436eb0e173
commit 3278e8b418

View File

@@ -84,6 +84,8 @@ namespace k8s.Tests.Logging
throw new ArgumentNullException(nameof(formatter));
}
try
{
TestOutput.WriteLine(string.Format(
"[{0}] {1}: {2}",
level,
@@ -96,6 +98,20 @@ namespace k8s.Tests.Logging
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;
}
}
/// <summary>
/// Check if the given <paramref name="logLevel"/> is enabled.