summaryrefslogtreecommitdiff
path: root/tests/test_glib.py
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@gnome.org>2012-11-30 09:04:20 +0100
committerMartin Pitt <martinpitt@gnome.org>2012-11-30 09:04:20 +0100
commit263b9f97e748746e1d26847a82a4d6e53a42798a (patch)
tree941ad637ada2f2c6ea754688ba289b3cc258a630 /tests/test_glib.py
parent8e4e822cb273db4eb7e6e40f4739eeebee00798a (diff)
downloadpygobject-263b9f97e748746e1d26847a82a4d6e53a42798a.tar.gz
Robustify test_glib.TestGLib.test_io_add_watch_pyfile
Use a longer timeout to avoid races on slow architectures, and cut the main loop as soon as we received all expected events.
Diffstat (limited to 'tests/test_glib.py')
-rw-r--r--tests/test_glib.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/test_glib.py b/tests/test_glib.py
index 5feae1f5..9ef60e42 100644
--- a/tests/test_glib.py
+++ b/tests/test_glib.py
@@ -173,6 +173,9 @@ https://my.org/q?x=1&y=2
def cb(file, condition):
call_data.append((file, condition, file.readline()))
+ if len(call_data) == 2:
+ # avoid having to wait for the full timeout
+ ml.quit()
return True
# io_add_watch() takes an IOChannel, calling with a Python file is deprecated
@@ -182,7 +185,7 @@ https://my.org/q?x=1&y=2
self.assertTrue(issubclass(warn[0].category, PyGIDeprecationWarning))
ml = GLib.MainLoop()
- GLib.timeout_add(400, ml.quit)
+ GLib.timeout_add(2000, ml.quit)
ml.run()
cmd.wait()