mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 12:41:50 +01:00
tests: Fix subsequent tests after first power-profile test failure
If the first power-profile installed test fails (for example, because xdg-desktop-portal isn’t available), correctly tear down the dbusmock object, or it will cause setUp() to fail when the next test in the suite is run. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #2481
This commit is contained in:
parent
d051ef1611
commit
4f62fdfd29
@ -66,12 +66,16 @@ try:
|
|||||||
try:
|
try:
|
||||||
self.xdp = subprocess.Popen([XDG_DESKTOP_PORTAL_PATH])
|
self.xdp = subprocess.Popen([XDG_DESKTOP_PORTAL_PATH])
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
self.p_mock.terminate()
|
||||||
|
self.p_mock.wait()
|
||||||
raise unittest.SkipTest("xdg-desktop-portal not available")
|
raise unittest.SkipTest("xdg-desktop-portal not available")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.wait_for_bus_object('org.freedesktop.portal.Desktop',
|
self.wait_for_bus_object('org.freedesktop.portal.Desktop',
|
||||||
'/org/freedesktop/portal/desktop')
|
'/org/freedesktop/portal/desktop')
|
||||||
except:
|
except:
|
||||||
|
self.p_mock.terminate()
|
||||||
|
self.p_mock.wait()
|
||||||
raise
|
raise
|
||||||
# subprocess.Popen(['gdbus', 'monitor', '--session', '--dest', 'org.freedesktop.portal.Desktop'])
|
# subprocess.Popen(['gdbus', 'monitor', '--session', '--dest', 'org.freedesktop.portal.Desktop'])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user