Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb49470

Browse files
committed
Ignore test-case on Python 3.12
1 parent 080d1bd commit fb49470

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/embed_tests/Codecs.cs

+17-5
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,23 @@ public void FloatDerivedDecoded()
371371
[Test]
372372
public void ExceptionDecodedNoInstance()
373373
{
374-
PyObjectConversions.RegisterDecoder(new InstancelessExceptionDecoder());
375-
using var scope = Py.CreateScope();
376-
var error = Assert.Throws<ValueErrorWrapper>(() => PythonEngine.Exec(
377-
$"[].__iter__().__next__()"));
378-
Assert.AreEqual(TestExceptionMessage, error.Message);
374+
if (Runtime.PyVersion < new Version(3, 12))
375+
{
376+
PyObjectConversions.RegisterDecoder(new InstancelessExceptionDecoder());
377+
using var scope = Py.CreateScope();
378+
379+
var error = Assert.Throws<ValueErrorWrapper>(() =>
380+
PythonEngine.Exec($"[].__iter__().__next__()")
381+
);
382+
Assert.AreEqual(TestExceptionMessage, error.Message);
383+
}
384+
else
385+
{
386+
Assert.Ignore(
387+
"This test does not work for Python 3.12, see " +
388+
"https://github.com/python/cpython/issues/101578"
389+
);
390+
}
379391
}
380392

381393
public static void AcceptsDateTime(DateTime v) {}

0 commit comments

Comments
 (0)