Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r49122:0f4680451831
Date: 2011-11-10 11:53 +0100
http://bitbucket.org/pypy/pypy/changeset/0f4680451831/

Log:    Attempt to fix this test to check with a valid fd.

diff --git a/pypy/module/select/test/test_select.py 
b/pypy/module/select/test/test_select.py
--- a/pypy/module/select/test/test_select.py
+++ b/pypy/module/select/test/test_select.py
@@ -214,11 +214,15 @@
 
     def test_poll(self):
         import select
-        class A(object):
-            def __int__(self):
-                return 3
-        
-        select.poll().poll(A()) # assert did not crash
+        readend, writeend = self.getpair()
+        try:
+            class A(object):
+                def __int__(self):
+                    return readend.fileno()
+            select.poll().poll(A()) # assert did not crash
+        finally:
+            readend.close()
+            writeend.close()
 
 class AppTestSelectWithPipes(_AppTestSelect):
     "Use a pipe to get pairs of file descriptors"
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to