From 4045d8f9f39db1aef38d1a779af070a150e292ea Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 24 Mar 2023 17:01:09 +0100 Subject: tests: fix tests with glib 2.76 Fallout from https://gitlab.gnome.org/GNOME/glib/-/commit/0ffe86a1f7e215e4561c3b9f1d03c3cd638ed00f Our test suite runs with G_DEBUG=fatal-criticals and the last glib release upgraded some warnings which we explicitely ignored or captured to criticals, making the tests fail in various places. Ignore those new criticals where needed. --- tests/test_properties.py | 2 +- tests/test_repository.py | 4 ++-- tests/test_signal.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_properties.py b/tests/test_properties.py index ec5df0ca..f8b7823b 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -688,7 +688,7 @@ class TestProperty(unittest.TestCase): # we test known-bad values here which cause Gtk-WARNING logs. # Explicitly allow these for this test. - with capture_glib_warnings(allow_warnings=True): + with capture_glib_warnings(allow_warnings=True, allow_criticals=True): o = C() self.assertEqual(o.prop_int, 1) diff --git a/tests/test_repository.py b/tests/test_repository.py index 0aa29b63..4390ff04 100644 --- a/tests/test_repository.py +++ b/tests/test_repository.py @@ -364,7 +364,7 @@ class Test(unittest.TestCase): # also raise a RuntimeError. GIMarshallingTests.NoTypeFlags # cause flags registration info = repo.find_by_name('GIMarshallingTests', 'NoTypeFlags') - with capture_glib_warnings(allow_warnings=True): + with capture_glib_warnings(allow_warnings=True, allow_criticals=True): self.assertRaises(RuntimeError, GIRepository.flags_register_new_gtype_and_add, info) @@ -374,7 +374,7 @@ class Test(unittest.TestCase): # also raise a RuntimeError. GIMarshallingTests.Enum # cause enum registration info = repo.find_by_name('GIMarshallingTests', 'Enum') - with capture_glib_warnings(allow_warnings=True): + with capture_glib_warnings(allow_warnings=True, allow_criticals=True): self.assertRaises(RuntimeError, GIRepository.enum_register_new_gtype_and_add, info) diff --git a/tests/test_signal.py b/tests/test_signal.py index e327d374..8a935fd8 100644 --- a/tests/test_signal.py +++ b/tests/test_signal.py @@ -365,7 +365,7 @@ class TestClosures(unittest.TestCase): self.count += 1 def _callback_invalid_stop_emission_name(self, obj, prop): - with capture_glib_warnings(allow_warnings=True) as warn: + with capture_glib_warnings(allow_warnings=True, allow_criticals=True) as warn: obj.stop_emission_by_name('notasignal::baddetail') self.emission_error = True self.assertTrue(warn) -- cgit v1.2.1