TestGValue.test_gvalue_flat_array_in_item_marshal_failure test fails with Python 3.12
When running the test suite against Python 3.12.0b1, I'm getting the following test failure:
============================================================== FAILURES ===============================================================
______________________________________ TestGValue.test_gvalue_flat_array_in_item_marshal_failure ______________________________________
self = <tests.test_gi.TestGValue testMethod=test_gvalue_flat_array_in_item_marshal_failure>
def test_gvalue_flat_array_in_item_marshal_failure(self):
# Tests the failure to marshal 2^256 to a GValue mid-way through the array marshaling.
self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
[42, 2 ** 256, True])
self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
[GLib.MAXINT + 1, "42", True])
self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
[GLib.MININT - 1, "42", True])
with pytest.raises(
OverflowError,
match='Item 0: %d not in range %d to %d' % (
GLib.MAXINT + 1, GLib.MININT, GLib.MAXINT)):
> GIMarshallingTests.gvalue_flat_array([GLib.MAXINT + 1, "42", True])
E OverflowError: 2147483648 not in range -2147483648 to 2147483647
../pygobject-3.44.1/tests/test_gi.py:1580: OverflowError
During handling of the above exception, another exception occurred:
self = <tests.test_gi.TestGValue testMethod=test_gvalue_flat_array_in_item_marshal_failure>
def test_gvalue_flat_array_in_item_marshal_failure(self):
# Tests the failure to marshal 2^256 to a GValue mid-way through the array marshaling.
self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
[42, 2 ** 256, True])
self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
[GLib.MAXINT + 1, "42", True])
self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
[GLib.MININT - 1, "42", True])
> with pytest.raises(
OverflowError,
match='Item 0: %d not in range %d to %d' % (
GLib.MAXINT + 1, GLib.MININT, GLib.MAXINT)):
E AssertionError: Regex pattern did not match.
E Regex: 'Item 0: 2147483648 not in range -2147483648 to 2147483647'
E Input: '2147483648 not in range -2147483648 to 2147483647'
../pygobject-3.44.1/tests/test_gi.py:1576: AssertionError
I can reproduce with git @ f5f9094b as well.
Edited by Michał Górny