summaryrefslogtreecommitdiff
path: root/urwid/tests
diff options
context:
space:
mode:
authorIan Ward <ian@excess.org>2017-06-07 20:23:34 -0400
committerGitHub <noreply@github.com>2017-06-07 20:23:34 -0400
commit949f4ec91a0a4700c9784dc6e382e02e23a807f7 (patch)
tree52b4afc4faf98e312f386947ebadaf77061aebfd /urwid/tests
parente06c76d0ad59bb34180e28deafd07c87fdc9066c (diff)
parent4b0ed8b6030450e6d99909a7c683e9642e546387 (diff)
downloadurwid-949f4ec91a0a4700c9784dc6e382e02e23a807f7.tar.gz
Merge pull request #238 from mwhudson/issue-164
fix test_remove_watch_file flakiness
Diffstat (limited to 'urwid/tests')
-rw-r--r--urwid/tests/test_event_loops.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/urwid/tests/test_event_loops.py b/urwid/tests/test_event_loops.py
index c85bbed..b01212d 100644
--- a/urwid/tests/test_event_loops.py
+++ b/urwid/tests/test_event_loops.py
@@ -30,9 +30,14 @@ class EventLoopTestMixin(object):
def test_remove_watch_file(self):
evl = self.evl
- handle = evl.watch_file(5, lambda: None)
- self.assertTrue(evl.remove_watch_file(handle))
- self.assertFalse(evl.remove_watch_file(handle))
+ fd_r, fd_w = os.pipe()
+ try:
+ handle = evl.watch_file(fd_r, lambda: None)
+ self.assertTrue(evl.remove_watch_file(handle))
+ self.assertFalse(evl.remove_watch_file(handle))
+ finally:
+ os.close(fd_r)
+ os.close(fd_w)
_expected_idle_handle = 1