diff options
Diffstat (limited to 'tests/test_gio.py')
-rw-r--r-- | tests/test_gio.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_gio.py b/tests/test_gio.py index 10ef6ac7..ba05f83d 100644 --- a/tests/test_gio.py +++ b/tests/test_gio.py @@ -303,8 +303,11 @@ class TestFile(unittest.TestCase): destination = gio.File('copy.txt') def copied(source_, result): - self.assert_(source_ is source) - self.failUnless(source_.copy_finish(result)) + try: + self.assert_(source_ is source) + self.failUnless(source_.copy_finish(result)) + finally: + loop.quit() def progress(current, total): self.assert_(isinstance(current, long)) @@ -312,7 +315,9 @@ class TestFile(unittest.TestCase): self.assert_(0 <= current <= total) try: + loop = glib.MainLoop() source.copy_async(destination, copied, progress_callback = progress) + loop.run() self.failUnless(os.path.exists('copy.txt')) self.assertEqual(open('file.txt').read(), |