Blame SOURCES/python-urwid-test_event_loops.patch

d88811
commit 4b0ed8b6030450e6d99909a7c683e9642e546387
d88811
Author: Michael Hudson-Doyle <michael.hudson@canonical.com>
d88811
Date:   Wed Jun 7 13:52:17 2017 -0700
d88811
d88811
    fix test_remove_watch_file flakiness
d88811
    
d88811
    pass a known-good file descriptor to watch_file rather than hard-coding 5
d88811
    
d88811
    Fixes #164
d88811
d88811
diff --git a/urwid/tests/test_event_loops.py b/urwid/tests/test_event_loops.py
d88811
index c85bbed..b01212d 100644
d88811
--- a/urwid/tests/test_event_loops.py
d88811
+++ b/urwid/tests/test_event_loops.py
d88811
@@ -30,9 +30,14 @@ class EventLoopTestMixin(object):
d88811
 
d88811
     def test_remove_watch_file(self):
d88811
         evl = self.evl
d88811
-        handle = evl.watch_file(5, lambda: None)
d88811
-        self.assertTrue(evl.remove_watch_file(handle))
d88811
-        self.assertFalse(evl.remove_watch_file(handle))
d88811
+        fd_r, fd_w = os.pipe()
d88811
+        try:
d88811
+            handle = evl.watch_file(fd_r, lambda: None)
d88811
+            self.assertTrue(evl.remove_watch_file(handle))
d88811
+            self.assertFalse(evl.remove_watch_file(handle))
d88811
+        finally:
d88811
+            os.close(fd_r)
d88811
+            os.close(fd_w)
d88811
 
d88811
     _expected_idle_handle = 1
d88811