summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:38:56 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2017-07-12 08:38:59 +0900
commit705bf16f6a14a07ccdc0c1a5fe1b31d92c3bd96e (patch)
treedd6f9f0e2056cdcf69380c9a0771deb6c5b49c78 /tests
parent44cf7615f8b29c5a41b4f8232f423683bebf2111 (diff)
downloadpygobject2-705bf16f6a14a07ccdc0c1a5fe1b31d92c3bd96e.tar.gz
pygobject2-705bf16f6a14a07ccdc0c1a5fe1b31d92c3bd96e.tar.bz2
pygobject2-705bf16f6a14a07ccdc0c1a5fe1b31d92c3bd96e.zip
Imported Upstream version 3.1.93
Change-Id: I1c47911211b99284d57c2547ee7e938f95483dec Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_overrides.py14
-rw-r--r--tests/test_pygtkcompat.py3
2 files changed, 12 insertions, 5 deletions
diff --git a/tests/test_overrides.py b/tests/test_overrides.py
index 58c77bf..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
@@ -19,6 +24,11 @@ from gi.repository import GdkPixbuf
import gi.overrides as overrides
import gi.types
+# in general we don't want tests to raise warnings, except when explicitly
+# testing with bad values; in those cases it will temporarily be set back to
+# ERROR
+GLib.log_set_always_fatal(GLib.LogLevelFlags.LEVEL_WARNING)
+
class TestGLib(unittest.TestCase):
def test_gvariant_create(self):
@@ -1859,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
diff --git a/tests/test_pygtkcompat.py b/tests/test_pygtkcompat.py
index 2567f68..b9765c3 100644
--- a/tests/test_pygtkcompat.py
+++ b/tests/test_pygtkcompat.py
@@ -74,7 +74,8 @@ class TestGTKCompat(unittest.TestCase):
gtk.gdk.Pixbuf()
def testPixbufLoader(self):
- gtk.gdk.PixbufLoader('png')
+ loader = gtk.gdk.PixbufLoader('png')
+ loader.close()
def testGdkWindow(self):
w = gtk.Window()