mirror of
https://gitlab.freedesktop.org/upower/upower.git
synced 2026-05-05 12:18:09 +02:00
Linux integration tests: Fix crash if there is no session D-BUS
This can happen in CI environments without a desktop session.
This commit is contained in:
parent
0b50cef90c
commit
e5bd3e80f3
1 changed files with 4 additions and 1 deletions
|
|
@ -81,7 +81,10 @@ class Tests(unittest.TestCase):
|
|||
# set up a fake system D-BUS
|
||||
cls.test_bus = Gio.TestDBus.new(Gio.TestDBusFlags.NONE)
|
||||
cls.test_bus.up()
|
||||
del os.environ['DBUS_SESSION_BUS_ADDRESS']
|
||||
try:
|
||||
del os.environ['DBUS_SESSION_BUS_ADDRESS']
|
||||
except KeyError:
|
||||
pass
|
||||
os.environ['DBUS_SYSTEM_BUS_ADDRESS'] = cls.test_bus.get_bus_address()
|
||||
|
||||
cls.dbus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue