[pygobject/pygobject-3-2] test_overrides: Find local gsettings schema with current glib



commit df44fdd3f8bcb285dc6abfe7b32ee816077f95eb
Author: Martin Pitt <martin pitt ubuntu com>
Date:   Thu Mar 22 09:58:21 2012 +0100

    test_overrides: Find local gsettings schema with current glib
    
    With current glib, gsettings now fails to find the gschemas.compiled during the
    tests. Move the setting of $GSETTINGS_SCHEMA_DIR before the module import,
    which makes this work again.

 tests/test_overrides.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 5a3457c..78e589f 100644
--- a/tests/test_overrides.py
+++ b/tests/test_overrides.py
@@ -9,6 +9,11 @@ sys.path.insert(0, "../")
 
 from compathelper import _long, _unicode, _bytes
 
+os.environ['GSETTINGS_BACKEND'] = 'memory'
+# support a separate build tree, so look in build dir first
+os.environ['GSETTINGS_SCHEMA_DIR'] = os.environ.get('TESTS_BUILDDIR', 
+        os.path.dirname(__file__))
+
 from gi.repository import GLib
 from gi.repository import GObject
 from gi.repository import Gdk
@@ -1864,10 +1869,6 @@ class TestGtk(unittest.TestCase):
 
 class TestGio(unittest.TestCase):
     def setUp(self):
-        os.environ['GSETTINGS_BACKEND'] = 'memory'
-        # support a separate build tree, so look in build dir first
-        os.environ['GSETTINGS_SCHEMA_DIR'] = os.environ.get('TESTS_BUILDDIR', 
-                os.path.dirname(__file__))
         self.settings = Gio.Settings('org.gnome.test')
         # we change the values in the tests, so set them to predictable start
         # value



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