[glib/wip/smcv/skip-low-mem] tests: Skip MemoryMonitor test if GObject-Introspection is too old



commit f0936ceef8496d61eb4a8f78733848b4cf62fddb
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-portal.py.in | 6 ++++++
 1 file changed, 6 insertions(+)
---
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]