Apply upstream fix for EINTR handling in test_vterm test case

Apply upstream fix for test_remove_watch_file flakiness
This commit is contained in:
David Cantrell 2017-11-15 14:00:23 -05:00
parent 9929ef044b
commit c6079d6cd0
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,32 @@
commit 4b0ed8b6030450e6d99909a7c683e9642e546387
Author: Michael Hudson-Doyle <michael.hudson@canonical.com>
Date: Wed Jun 7 13:52:17 2017 -0700
fix test_remove_watch_file flakiness
pass a known-good file descriptor to watch_file rather than hard-coding 5
Fixes #164
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

View File

@ -10,6 +10,9 @@ Source0: https://pypi.python.org/packages/source/u/urwid/urwid-%{version}.
# https://github.com/urwid/urwid/pull/237/commits/f68f2cf089cfd5ec45863baf59a91d5aeb0cf5c3
Patch0: python-urwid-test_vterm-EINTR.patch
# https://github.com/urwid/urwid/commit/4b0ed8b6030450e6d99909a7c683e9642e546387
Patch1: python-urwid-test_event_loops.patch
%global _description\
Urwid is a Python library for making text console applications. It has\
many features including fluid interface resizing, support for UTF-8 and\
@ -46,6 +49,7 @@ BuildRequires: /usr/bin/2to3
%prep
%setup -q -n urwid-%{version}
%patch0 -p1
%patch1 -p1
find urwid -type f -name "*.py" -exec sed -i -e '/^#!\//, 1d' {} \;
find urwid -type f -name "*.py" -exec chmod 644 {} \;
@ -90,6 +94,7 @@ popd
%changelog
* Wed Nov 15 2017 David Cantrell <dcantrell@redhat.com> - 1.3.1-2
- Apply upstream fix for EINTR handling in test_vterm test case
- Apply upstream fix for test_remove_watch_file flakiness
* Sat Aug 19 2017 Petr Viktorin <pviktori@redhat.com> - 1.3.1-1
- Update to upstream bugfix release 1.3.1