forked from pool/python-urwid
Accepting request 501843 from home:alois:branches:devel:languages:python
Should work this time. OBS-URL: https://build.opensuse.org/request/show/501843 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-urwid?expand=0&rev=32
This commit is contained in:
34
python-urwid-fix_py3_test.patch
Normal file
34
python-urwid-fix_py3_test.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
From 4b0ed8b6030450e6d99909a7c683e9642e546387 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Hudson-Doyle <michael.hudson@canonical.com>
|
||||
Date: Wed, 7 Jun 2017 13:52:17 -0700
|
||||
Subject: [PATCH] fix test_remove_watch_file flakiness
|
||||
|
||||
pass a known-good file descriptor to watch_file rather than hard-coding 5
|
||||
|
||||
Fixes #164
|
||||
---
|
||||
urwid/tests/test_event_loops.py | 11 ++++++++---
|
||||
1 file 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 @@ def test_remove_alarm(self):
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user