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>
This commit is contained in:
Simon McVittie 2020-02-28 12:29:09 +00:00 committed by Simon McVittie
parent 369626e310
commit fdbd9ed7f7
2 changed files with 12 additions and 0 deletions

View File

@ -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)

View File

@ -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)