[glib/glib-2-64: 3/5] tests: Skip MemoryMonitor test if GObject-Introspection is too old



commit 3704d53b430b1f9a7be8410362b5217f1da8ca29
Author: Simon McVittie <smcv debian org>
Date:   Fri Feb 28 12:29:09 2020 +0000

    tests: Skip MemoryMonitor test if GObject-Introspection is too old
    
    Distributions will likely want to update GLib before
    GObject-Introspection, to avoid circular dependencies.
    
    Signed-off-by: Simon McVittie <smcv debian org>

 gio/tests/memory-monitor-dbus.py.in   | 6 ++++++
 gio/tests/memory-monitor-portal.py.in | 6 ++++++
 2 files changed, 12 insertions(+)
---
diff --git a/gio/tests/memory-monitor-dbus.py.in b/gio/tests/memory-monitor-dbus.py.in
index 43c6c63fd..675024a50 100755
--- a/gio/tests/memory-monitor-dbus.py.in
+++ b/gio/tests/memory-monitor-dbus.py.in
@@ -38,6 +38,12 @@ class TestLowMemoryMonitor(dbusmock.DBusTestCase):
         klass.dbus_con = klass.get_dbus(True)
 
     def setUp(self):
+        try:
+            Gio.MemoryMonitor
+        except AttributeError:
+            raise unittest.SkipTest('Low memory monitor not in '
+                                    'introspection data. Requires '
+                                    'GObject-Introspection ≥ 1.63.2')
         try:
             (self.p_mock, self.obj_lmm) = self.spawn_server_template(
                 'low_memory_monitor', {}, stdout=subprocess.PIPE)
diff --git a/gio/tests/memory-monitor-portal.py.in b/gio/tests/memory-monitor-portal.py.in
index 8572d8f69..37c206fd4 100755
--- a/gio/tests/memory-monitor-portal.py.in
+++ b/gio/tests/memory-monitor-portal.py.in
@@ -40,6 +40,12 @@ class TestLowMemoryMonitorPortal(dbusmock.DBusTestCase):
         klass.start_session_bus()
 
     def setUp(self):
+        try:
+            Gio.MemoryMonitor
+        except AttributeError:
+            raise unittest.SkipTest('Low memory monitor not in '
+                                    'introspection data. Requires '
+                                    'GObject-Introspection ≥ 1.63.2')
         try:
             (self.p_mock, self.obj_lmm) = self.spawn_server_template(
                 'low_memory_monitor', {}, stdout=subprocess.PIPE)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]