summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-11-30 08:44:56 +0100
committerMartin Pitt <martinpitt@gnome.org>2012-11-30 08:55:59 +0100
commitc36e12368bb430ca1fb6eafd7d86f59c44965a31 (patch)
tree876c9076611f92683409c6b9733950c25cf4a01b
parent1ce98d453b451b89b8bd0154ed1059c4939263e3 (diff)
downloadpygobject-3-4.tar.gz
test_overrides_gtk: Ignore GVFS warnings from FileChooserDialogpygobject-3-4
Do not cause GVFS warnings from Gtk.FileChooserDialog (which may concern unavailable monitor backends in the test environment) to fail the tests.
-rw-r--r--tests/test_overrides_gtk.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py
index ee41457f..23b532b5 100644
--- a/tests/test_overrides_gtk.py
+++ b/tests/test_overrides_gtk.py
@@ -292,9 +292,15 @@ class TestGtk(unittest.TestCase):
self.assertEqual('color selection dialog test', dialog.get_title())
# Gtk.FileChooserDialog
- dialog = Gtk.FileChooserDialog(title='file chooser dialog test',
- buttons=('test-button1', 1),
- action=Gtk.FileChooserAction.SAVE)
+ # might cause a GVFS warning, do not break on this
+ old_mask = GLib.log_set_always_fatal(
+ GLib.LogLevelFlags.LEVEL_CRITICAL | GLib.LogLevelFlags.LEVEL_ERROR)
+ try:
+ dialog = Gtk.FileChooserDialog(title='file chooser dialog test',
+ buttons=('test-button1', 1),
+ action=Gtk.FileChooserAction.SAVE)
+ finally:
+ GLib.log_set_always_fatal(old_mask)
self.assertTrue(isinstance(dialog, Gtk.Dialog))
self.assertTrue(isinstance(dialog, Gtk.Window))