mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-24 21:16:15 +01:00
tests: Skip GMemoryMonitor tests if the dbusmock template is not available
This template is not currently in any released version of dbusmock.
This commit is contained in:
parent
b413c50dcd
commit
0d4f1a9b21
@ -38,8 +38,12 @@ class TestLowMemoryMonitor(dbusmock.DBusTestCase):
|
||||
klass.dbus_con = klass.get_dbus(True)
|
||||
|
||||
def setUp(self):
|
||||
(self.p_mock, self.obj_lmm) = self.spawn_server_template(
|
||||
'low_memory_monitor', {}, stdout=subprocess.PIPE)
|
||||
try:
|
||||
(self.p_mock, self.obj_lmm) = self.spawn_server_template(
|
||||
'low_memory_monitor', {}, stdout=subprocess.PIPE)
|
||||
except ModuleNotFoundError:
|
||||
raise unittest.SkipTest("Low memory monitor dbusmock template not "
|
||||
"found. Requires dbusmock ≥ 0.18.4.")
|
||||
# set log to nonblocking
|
||||
flags = fcntl.fcntl(self.p_mock.stdout, fcntl.F_GETFL)
|
||||
fcntl.fcntl(self.p_mock.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK)
|
||||
|
@ -40,8 +40,12 @@ class TestLowMemoryMonitorPortal(dbusmock.DBusTestCase):
|
||||
klass.start_session_bus()
|
||||
|
||||
def setUp(self):
|
||||
(self.p_mock, self.obj_lmm) = self.spawn_server_template(
|
||||
'low_memory_monitor', {}, stdout=subprocess.PIPE)
|
||||
try:
|
||||
(self.p_mock, self.obj_lmm) = self.spawn_server_template(
|
||||
'low_memory_monitor', {}, stdout=subprocess.PIPE)
|
||||
except ModuleNotFoundError:
|
||||
raise unittest.SkipTest("Low memory monitor dbusmock template not "
|
||||
"found. Requires dbusmock ≥ 0.18.4.")
|
||||
# set log to nonblocking
|
||||
flags = fcntl.fcntl(self.p_mock.stdout, fcntl.F_GETFL)
|
||||
fcntl.fcntl(self.p_mock.stdout, fcntl.F_SETFL, flags | os.O_NONBLOCK)
|
||||
|
Loading…
Reference in New Issue
Block a user