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

Skip to content
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
Prev Previous commit
Next Next commit
Ignore test-case on Python 3.12
  • Loading branch information
filmor committed Oct 4, 2023
commit fb494705652af998a4f346aeb88ebff836c72eb4
22 changes: 17 additions & 5 deletions src/embed_tests/Codecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,23 @@ public void FloatDerivedDecoded()
[Test]
public void ExceptionDecodedNoInstance()
{
PyObjectConversions.RegisterDecoder(new InstancelessExceptionDecoder());
using var scope = Py.CreateScope();
var error = Assert.Throws<ValueErrorWrapper>(() => PythonEngine.Exec(
$"[].__iter__().__next__()"));
Assert.AreEqual(TestExceptionMessage, error.Message);
if (Runtime.PyVersion < new Version(3, 12))
{
PyObjectConversions.RegisterDecoder(new InstancelessExceptionDecoder());
using var scope = Py.CreateScope();

var error = Assert.Throws<ValueErrorWrapper>(() =>
PythonEngine.Exec($"[].__iter__().__next__()")
);
Assert.AreEqual(TestExceptionMessage, error.Message);
}
else
{
Assert.Ignore(
"This test does not work for Python 3.12, see " +
"https://github.com/python/cpython/issues/101578"
);
}
}

public static void AcceptsDateTime(DateTime v) {}
Expand Down