Skip to content
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

Skip test if exception SkipTest is raised #1895

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/IronPython.Tests/Cases/CaseExecuter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using IronPython.Hosting;
using IronPython.Runtime;
using IronPython.Runtime.Exceptions;
using IronPython.Runtime.Types;

using Microsoft.Scripting;
using Microsoft.Scripting.Hosting;
Expand Down Expand Up @@ -300,6 +301,13 @@ private int GetResult(TestInfo testcase, ScriptEngine engine, ScriptSource sourc
#pragma warning disable SYSLIB0006 // 'Thread.ResetAbort is not supported and throws PlatformNotSupportedException.'
Thread.ResetAbort();
#pragma warning restore SYSLIB0006
} catch (Exception ex) when (ex.GetPythonException() is not null and var pex) {
if (DynamicHelpers.GetPythonType(pex).Name == "SkipTest") {
NUnit.Framework.TestContext.Progress.WriteLine($"Test {testcase.Name} skipped: {pex}");
res = 0;
} else {
throw;
}
}
}, maxStackSize) {
IsBackground = true
Expand Down