[Python-checkins] cpython (3.2): Fix flakiness in test_socketserver

antoine.pitrou python-checkins at python.org
Mon Apr 9 01:23:45 CEST 2012


http://hg.python.org/cpython/rev/4f5b44de5c37
changeset:   76169:4f5b44de5c37
branch:      3.2
parent:      76165:5493d44b56d8
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Mon Apr 09 01:16:47 2012 +0200
summary:
  Fix flakiness in test_socketserver

files:
  Lib/test/test_socketserver.py |  5 ++++-
  1 files changed, 4 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -34,8 +34,11 @@
     if hasattr(signal, 'alarm'):
         signal.alarm(n)
 
+# Remember real select() to avoid interferences with mocking
+_real_select = select.select
+
 def receive(sock, n, timeout=20):
-    r, w, x = select.select([sock], [], [], timeout)
+    r, w, x = _real_select([sock], [], [], timeout)
     if sock in r:
         return sock.recv(n)
     else:

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


More information about the Python-checkins mailing list