[pypy-svn] r28857 - in pypy/dist/pypy: . module/_stackless/test

hpk at codespeak.net hpk at codespeak.net
Fri Jun 16 07:02:51 CEST 2006


Author: hpk
Date: Fri Jun 16 07:02:48 2006
New Revision: 28857

Modified:
   pypy/dist/pypy/conftest.py
   pypy/dist/pypy/module/_stackless/test/test_coroutine.py
   pypy/dist/pypy/module/_stackless/test/test_greenlet.py
   pypy/dist/pypy/module/_stackless/test/test_interp_clonable.py
   pypy/dist/pypy/module/_stackless/test/test_interp_coroutine.py
   pypy/dist/pypy/module/_stackless/test/test_pickle.py
   pypy/dist/pypy/module/_stackless/test/test_stackless.py
Log:
added a helper skip_on_missing_buildoptions to conftest.py 
also modified all the stackless test but XXX: please check 
which of the stackless tests are actually supposed to
run on py.py ... 



Modified: pypy/dist/pypy/conftest.py
==============================================================================
--- pypy/dist/pypy/conftest.py	(original)
+++ pypy/dist/pypy/conftest.py	Fri Jun 16 07:02:48 2006
@@ -146,6 +146,22 @@
     #    py.test.skip('test requires object space %r' % (name,))
     return space
 
+def skip_on_missing_buildoption(**ropts): 
+    __tracebackhide__ = True
+    import sys
+    options = getattr(sys, 'pypy_translation_info', None)
+    if options is None:
+        py.test.skip("not running on translated pypy "
+                     "(btw, i would need options: %s)" %
+                     (ropts,))
+    for opt in ropts: 
+        if not options.has_key(opt) or options[opt] != ropts[opt]: 
+            break
+    else:
+        return
+    py.test.skip("need translated pypy with: %s, got %s" 
+                 %(ropts,options))
+
 class LazyObjSpaceGetter(object):
     def __get__(self, obj, cls=None):
         space = gettestobjspace()

Modified: pypy/dist/pypy/module/_stackless/test/test_coroutine.py
==============================================================================
--- pypy/dist/pypy/module/_stackless/test/test_coroutine.py	(original)
+++ pypy/dist/pypy/module/_stackless/test/test_coroutine.py	Fri Jun 16 07:02:48 2006
@@ -1,6 +1,9 @@
-from pypy.conftest import gettestobjspace
+from pypy.conftest import gettestobjspace, skip_on_missing_buildoption
 
 # no real testing possible without compiling stackless pypy
+#
+def setup_module(mod):
+    skip_on_missing_buildoption(stackless=True)
 
 class AppTest_Coroutine:
 

Modified: pypy/dist/pypy/module/_stackless/test/test_greenlet.py
==============================================================================
--- pypy/dist/pypy/module/_stackless/test/test_greenlet.py	(original)
+++ pypy/dist/pypy/module/_stackless/test/test_greenlet.py	Fri Jun 16 07:02:48 2006
@@ -1,4 +1,7 @@
-from pypy.conftest import gettestobjspace
+from pypy.conftest import gettestobjspace, skip_on_missing_buildoption
+
+def setup_module(mod):
+    skip_on_missing_buildoption(stackless=True)
 
 class AppTest_Coroutine:
 

Modified: pypy/dist/pypy/module/_stackless/test/test_interp_clonable.py
==============================================================================
--- pypy/dist/pypy/module/_stackless/test/test_interp_clonable.py	(original)
+++ pypy/dist/pypy/module/_stackless/test/test_interp_clonable.py	Fri Jun 16 07:02:48 2006
@@ -7,7 +7,10 @@
 from pypy.rpython.memory.test import test_transformed_gc
 from pypy.module._stackless.interp_clonable import ClonableCoroutine
 from pypy.module._stackless.interp_clonable import AbstractThunk, fork
+from pypy.conftest import skip_on_missing_buildoption
 
+def setup_module(mod):
+    skip_on_missing_buildoption(stackless=True)
 
 class TestClonableCoroutine(test_transformed_gc.GCTest):
 

Modified: pypy/dist/pypy/module/_stackless/test/test_interp_coroutine.py
==============================================================================
--- pypy/dist/pypy/module/_stackless/test/test_interp_coroutine.py	(original)
+++ pypy/dist/pypy/module/_stackless/test/test_interp_coroutine.py	Fri Jun 16 07:02:48 2006
@@ -6,6 +6,10 @@
 from pypy.module._stackless.interp_coroutine import syncstate, Coroutine, AbstractThunk
 from pypy.translator.c.test.test_stackless import StacklessTest
 from pypy.translator.c import gc
+from pypy.conftest import skip_on_missing_buildoption
+
+def setup_module(mod):
+    skip_on_missing_buildoption(stackless=True)
 
 def output(stuff):
     os.write(2, stuff + '\n')

Modified: pypy/dist/pypy/module/_stackless/test/test_pickle.py
==============================================================================
--- pypy/dist/pypy/module/_stackless/test/test_pickle.py	(original)
+++ pypy/dist/pypy/module/_stackless/test/test_pickle.py	Fri Jun 16 07:02:48 2006
@@ -1,16 +1,10 @@
-from pypy.conftest import gettestobjspace
+from pypy.conftest import gettestobjspace, skip_on_missing_buildoption
 import py
 
 # app-level testing of coroutine pickling
 
 def setup_module(mod):
-    import sys
-    options = getattr(sys, 'pypy_translation_info', None)
-    if options is None:
-        py.test.skip("only runs on translated pypy with stackless")
-    if not options['stackless']:
-        py.test.skip("only runs with a stackless build")
-        
+    skip_on_missing_buildoption(stackless=True)
 
 class TestPickle:
 

Modified: pypy/dist/pypy/module/_stackless/test/test_stackless.py
==============================================================================
--- pypy/dist/pypy/module/_stackless/test/test_stackless.py	(original)
+++ pypy/dist/pypy/module/_stackless/test/test_stackless.py	Fri Jun 16 07:02:48 2006
@@ -1,4 +1,10 @@
-from pypy.conftest import gettestobjspace
+from pypy.conftest import gettestobjspace, skip_on_missing_buildoption
+
+def setup_module(mod):
+    # XXX the below AppTest class code seems to imply that we
+    # want to run on py.py as well? 
+    skip_on_missing_buildoption(stackless=True)
+    
 
 class AppTest_Stackless:
 



More information about the Pypy-commit mailing list