[pygobject] test_overrides_gtk: Ignore GVFS warnings from FileChooserDialog
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject] test_overrides_gtk: Ignore GVFS warnings from FileChooserDialog
- Date: Fri, 30 Nov 2012 07:45:50 +0000 (UTC)
commit 8e4e822cb273db4eb7e6e40f4739eeebee00798a
Author: Martin Pitt <martinpitt gnome org>
Date: Fri Nov 30 08:44:56 2012 +0100
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 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py
index 6148479..7ed8344 100644
--- a/tests/test_overrides_gtk.py
+++ b/tests/test_overrides_gtk.py
@@ -277,9 +277,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))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]