From c36e12368bb430ca1fb6eafd7d86f59c44965a31 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 30 Nov 2012 08:44:56 +0100 Subject: test_overrides_gtk: Ignore GVFS warnings from FileChooserDialog Do not cause GVFS warnings from Gtk.FileChooserDialog (which may concern unavailable monitor backends in the test environment) to fail the tests. --- tests/test_overrides_gtk.py | 12 +++++++++--- 1 file 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)) -- cgit v1.2.1