[pypy-commit] pypy default: only skip poll tests on win32

bdkearns noreply at buildbot.pypy.org
Tue Apr 22 00:05:04 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r70842:28198ceccc4a
Date: 2014-04-21 15:04 -0700
http://bitbucket.org/pypy/pypy/changeset/28198ceccc4a/

Log:	only skip poll tests on win32

diff --git a/rpython/rlib/test/test_rpoll.py b/rpython/rlib/test/test_rpoll.py
--- a/rpython/rlib/test/test_rpoll.py
+++ b/rpython/rlib/test/test_rpoll.py
@@ -3,26 +3,42 @@
 import py
 
 from rpython.rlib.rsocket import *
-from rpython.rlib.rpoll import select
-try:
-    from rpython.rlib.rpoll import poll
-except ImportError:
-    py.test.skip('no poll available on this platform')
+from rpython.rlib.rpoll import *
 from rpython.rtyper.test.test_llinterp import interpret
 
+if os.name == 'nt':
+    has_poll = False
+else:
+    has_poll = True
+
+
 def setup_module(mod):
     rsocket_startup()
 
+
 def one_in_event(events, fd):
     assert len(events) == 1
     assert events[0][0] == fd
     assert events[0][1] & POLLIN
 
+
 def one_out_event(events, fd):
     assert len(events) == 1
     assert events[0][0] == fd
     assert events[0][1] & POLLOUT
 
+
+ at py.test.mark.skipif('has_poll')
+def test_no_poll():
+    try:
+        poll
+    except NameError:
+        pass
+    else:
+        assert False
+
+
+ at py.test.mark.skipif('not has_poll')
 def test_simple():
     serv = RSocket(AF_INET, SOCK_STREAM)
     serv.bind(INETAddress('127.0.0.1', INADDR_ANY))
@@ -65,9 +81,9 @@
     servconn.close()
     serv.close()
 
+
+ at py.test.mark.skipif('not has_poll')
 def test_exchange():
-    if not poll:
-        py.test.skip('poll not available for this platform')
     serv = RSocket(AF_INET, SOCK_STREAM)
     serv.bind(INETAddress('127.0.0.1', INADDR_ANY))
     serv.listen(1)
@@ -150,6 +166,7 @@
     f()
     interpret(f, [])
 
+
 def test_select_timeout():
     if os.name == 'nt':
         py.test.skip('cannot select on file handles on windows')
@@ -163,10 +180,16 @@
     interpret(f, [])
 
 
-def test_translate():
+def test_translate_select():
     from rpython.translator.c.test.test_genc import compile
+    def func():
+        select([], [], [], 0.0)
+    compile(func, [])
 
+
+ at py.test.mark.skipif('not has_poll')
+def test_translate_poll():
+    from rpython.translator.c.test.test_genc import compile
     def func():
         poll({})
-
     compile(func, [])


More information about the pypy-commit mailing list