summaryrefslogtreecommitdiff
path: root/tests/test_pygtkcompat.py
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-08-03 07:13:55 +0200
committerMartin Pitt <martinpitt@gnome.org>2012-08-03 07:15:33 +0200
commitdbc6df6aad7197fcf8721ade429baadd749f7069 (patch)
tree33858ba107dab496cfcab083f2bdb3484836b2db /tests/test_pygtkcompat.py
parent770e6abfd5bc5dad7d5f56a18f1ef63f9754ada9 (diff)
downloadpygobject-dbc6df6aad7197fcf8721ade429baadd749f7069.tar.gz
tests: Do not break on Pango warnings
In some restricted environments (like chroots) we sometimes get warnings from Pango when it cannot find an appropriate font. Do not make the tests fail on those.
Diffstat (limited to 'tests/test_pygtkcompat.py')
-rw-r--r--tests/test_pygtkcompat.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_pygtkcompat.py b/tests/test_pygtkcompat.py
index 37d208db..926910b9 100644
--- a/tests/test_pygtkcompat.py
+++ b/tests/test_pygtkcompat.py
@@ -6,6 +6,8 @@ import unittest
import sys
sys.path.insert(0, "../")
+from gi.repository import GLib
+
try:
from gi.repository import Pango
from gi.repository import Atk
@@ -100,7 +102,11 @@ class TestGTKCompat(unittest.TestCase):
liststore.append((1, 'One'))
liststore.append((2, 'Two'))
liststore.append((3, 'Three'))
+ # might cause a Pango warning, do not break on this
+ old_mask = GLib.log_set_always_fatal(
+ GLib.LogLevelFlags.LEVEL_CRITICAL | GLib.LogLevelFlags.LEVEL_ERROR)
combo = gtk.ComboBoxEntry(model=liststore)
+ GLib.log_set_always_fatal(old_mask)
combo.set_text_column(1)
combo.set_active(0)
self.assertEqual(combo.get_text_column(), 1)