[pypy-svn] r10610 - in pypy/branch/pycollect-dist-pypy/pypy: . lib/test2

hpk at codespeak.net hpk at codespeak.net
Thu Apr 14 12:43:23 CEST 2005


Author: hpk
Date: Thu Apr 14 12:43:23 2005
New Revision: 10610

Modified:
   pypy/branch/pycollect-dist-pypy/pypy/conftest.py
   pypy/branch/pycollect-dist-pypy/pypy/lib/test2/conftest.py
Log:
adjust pypy's test glue code slightly to the new
py.test naming


Modified: pypy/branch/pycollect-dist-pypy/pypy/conftest.py
==============================================================================
--- pypy/branch/pycollect-dist-pypy/pypy/conftest.py	(original)
+++ pypy/branch/pycollect-dist-pypy/pypy/conftest.py	Thu Apr 14 12:43:23 2005
@@ -10,14 +10,14 @@
 # PyPy's command line extra options (these are added 
 # to py.test's standard options) 
 #
-Option = py.test.Option
+Option = py.test.Config.Option
 
 #class Options: 
 #    group = "pypy options" 
 #    optionlist = 
 
-option = py.test.addoptions("pypy options", 
-        Option('-o', '--objspace', action="store", default=None, 
+option = py.test.Config.addoptions("pypy options", 
+        Option('-O', '--objspace', action="store", default=None, 
                type="string", dest="objspacename", 
                help="object space to run tests on."),
         Option('--oldstyle', action="store_true",dest="oldstyle", default=False,

Modified: pypy/branch/pycollect-dist-pypy/pypy/lib/test2/conftest.py
==============================================================================
--- pypy/branch/pycollect-dist-pypy/pypy/lib/test2/conftest.py	(original)
+++ pypy/branch/pycollect-dist-pypy/pypy/lib/test2/conftest.py	Thu Apr 14 12:43:23 2005
@@ -19,15 +19,12 @@
 
 libtest = py.path.local(pypy.__file__).dirpath()
 libtest = libtest.dirpath('lib-python-2.3.4', 'test')
-assert libtest.check(dir=1) 
-#conftest = make_cpy_module('234conftest', libtest.join('conftest.py'))
-conftest = libtest.join('conftest.py').getpymodule()
-conftest.__file__ = str(conftest.__file__)  # keep out the py's importhook 
+conftest = libtest.join('conftest.py').pyimport()
 
-def Module(fspath): 
+def Module(fspath, parent=None): 
     if option.allpypy: 
-        return conftest.Module(fspath) 
-    return UnittestModuleOnCPython(fspath) 
+        return conftest.Module(fspath, parent=parent) 
+    return UnittestModuleOnCPython(fspath, parent=parent) 
 
 class Directory(conftest.Directory): 
     def __iter__(self): 
@@ -39,19 +36,19 @@
         sys.modules['unittest'] = mod 
         mod.raises = py.test.raises 
         self.TestCase = mod.TestCase 
-        
-    def __iter__(self): 
+       
+    def run(self): 
         self._prepare() 
         try: 
             iterable = self._cache 
         except AttributeError: 
             iterable = self._cache = list(self._iter())
-        for x in iterable: 
-            yield x
+        return list(iterable) 
 
     def _iter(self): 
         name = self.fspath.purebasename 
         mod = make_cpy_module(name, self.fspath) 
+        print mod
         tlist = conftest.app_list_testmethods(mod, self.TestCase, [])
         for (setup, teardown, methods) in tlist: 
             for name, method in methods: 



More information about the Pypy-commit mailing list