[Python-checkins] cpython: Issue #8407: test_signal doesn't check signal delivery order

victor.stinner python-checkins at python.org
Tue May 31 22:31:46 CEST 2011


http://hg.python.org/cpython/rev/29e08a98281d
changeset:   70550:29e08a98281d
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Tue May 31 22:31:09 2011 +0200
summary:
  Issue #8407: test_signal doesn't check signal delivery order

Tthe signal delivery order is not portable or reliable.

files:
  Lib/test/test_signal.py |  11 ++++++-----
  1 files changed, 6 insertions(+), 5 deletions(-)


diff --git a/Lib/test/test_signal.py b/Lib/test/test_signal.py
--- a/Lib/test/test_signal.py
+++ b/Lib/test/test_signal.py
@@ -229,12 +229,13 @@
     def handler(self, signum, frame):
         pass
 
-    def check_signum(self, *signals, **kw):
+    def check_signum(self, *signals):
         data = os.read(self.read, len(signals)+1)
         raised = struct.unpack('%uB' % len(data), data)
-        if kw.get('unordered', False):
-            raised = set(raised)
-            signals = set(signals)
+        # We don't care of the signal delivery order (it's not portable or
+        # reliable)
+        raised = set(raised)
+        signals = set(signals)
         self.assertEqual(raised, signals)
 
     def test_wakeup_fd_early(self):
@@ -291,7 +292,7 @@
         # Unblocking the 2 signals calls the C signal handler twice
         signal.pthread_sigmask(signal.SIG_UNBLOCK, (signum1, signum2))
 
-        self.check_signum(signum1, signum2, unordered=True)
+        self.check_signum(signum1, signum2)
 
     def setUp(self):
         import fcntl

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list