[pypy-svn] r7908 - pypy/branch/src-pytest/pypy

arigo at codespeak.net arigo at codespeak.net
Fri Dec 17 20:01:54 CET 2004


Author: arigo
Date: Fri Dec 17 20:01:54 2004
New Revision: 7908

Modified:
   pypy/branch/src-pytest/pypy/conftest.py
Log:
Allow interp-level global tests that don't care about a 'space' argument.


Modified: pypy/branch/src-pytest/pypy/conftest.py
==============================================================================
--- pypy/branch/src-pytest/pypy/conftest.py	(original)
+++ pypy/branch/src-pytest/pypy/conftest.py	Fri Dec 17 20:01:54 2004
@@ -69,9 +69,13 @@
 
 class IntTestFunction(py.test.Item): 
     def execute(self, target, *args):
-        name = target.func_globals.get('objspacename', None) 
-        space = gettestobjspace(name) 
-        return target(space, *args)
+        co = target.func_code
+        if 'space' in co.co_varnames[:co.co_argcount]:
+            name = target.func_globals.get('objspacename', None) 
+            space = gettestobjspace(name) 
+            return target(space, *args)
+        else:
+            return target(*args)
 
 class AppTestFunction(py.test.Item): 
     def execute(self, target, *args): 



More information about the Pypy-commit mailing list