[gnome-settings-daemon/benzea/ci-fixes] tests: Reset org.gnome.desktop.session settings between tests




commit 67391a94519fccd3cae8c791d10bc638991ed713
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Jul 22 14:50:20 2021 +0200

    tests: Reset org.gnome.desktop.session settings between tests
    
    Otherwise settings may leak between tests, which can trigger test
    failures.

 tests/gsdtestcase.py | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/tests/gsdtestcase.py b/tests/gsdtestcase.py
index 88e71493..ec715b36 100644
--- a/tests/gsdtestcase.py
+++ b/tests/gsdtestcase.py
@@ -104,6 +104,7 @@ class GSDTestCase(X11SessionTestCase):
         klass.start_monitor()
         klass.addClassCleanup(klass.stop_monitor)
 
+        # Reset between tests in tearDown
         klass.settings_session = Gio.Settings(schema_id='org.gnome.desktop.session')
 
         # Make sure we get a backtrace when meson kills after a timeout
@@ -116,6 +117,8 @@ class GSDTestCase(X11SessionTestCase):
         daemon_running = self.daemon.poll() == None
         self.assertTrue(daemon_running or self.daemon_death_expected, 'daemon died during the test')
 
+        self.reset_settings(self.settings_session)
+
     def run(self, result=None):
         '''Show log files on failed tests
 


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