[dconf: 1/2] tests: Avoid using real system bus during tests



commit 429634f125819cfdcd0dfab0e5254fc7b687b7a6
Author: Tomasz Miąsko <>
Date:   Mon Feb 25 00:00:00 2019 +0000

    tests: Avoid using real system bus during tests
    
    When a bus address is unset the default value will be used. While the
    session bus address is overwritten during tests, this not the case for
    system bus.
    
    Use empty invalid addresses as a safer default to avoid accidental
    connections to the external buses.
    
    Issue #51.

 tests/test-dconf.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tests/test-dconf.py b/tests/test-dconf.py
index cf9bb14..6cd80a8 100755
--- a/tests/test-dconf.py
+++ b/tests/test-dconf.py
@@ -802,8 +802,8 @@ if __name__ == '__main__':
     os.environ.pop('DCONF_PROFILE', None)
     os.environ.pop('XDG_DATA_DIRS', None)
     # Avoid interfering with external message buses.
-    os.environ.pop('DBUS_SYSTEM_BUS_ADDRESS', None)
-    os.environ.pop('DBUS_SESSION_BUS_ADDRESS', None)
+    os.environ['DBUS_SYSTEM_BUS_ADDRESS'] = ''
+    os.environ['DBUS_SESSION_BUS_ADDRESS'] = ''
 
     if len(sys.argv) < 3:
         message = 'Usage: {} path-to-dconf path-to-dconf-service'.format(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]