From 24cd9864769878948417c25d7c96599943a26b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 7 Feb 2020 17:46:26 +0100 Subject: [PATCH] tests/fprintd: Use GTestDBus unset to undefine envs Unset the dbus environment that may affect the dbus tests using GTestDBus utility, instead of doing it manually. --- tests/fprintd.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/fprintd.py b/tests/fprintd.py index 8f35b24..817b777 100755 --- a/tests/fprintd.py +++ b/tests/fprintd.py @@ -154,10 +154,7 @@ class FPrintdTest(dbusmock.DBusTestCase): cls.test_bus = Gio.TestDBus.new(Gio.TestDBusFlags.NONE) cls.test_bus.up() - try: - del os.environ['DBUS_SESSION_BUS_ADDRESS'] - except KeyError: - pass + cls.test_bus.unset() addr = cls.test_bus.get_bus_address() os.environ['DBUS_SYSTEM_BUS_ADDRESS'] = addr cls.dbus = Gio.DBusConnection.new_for_address_sync(addr,