[pypy-svn] r16355 - in pypy/dist: lib-python pypy/tool/pytest

hpk at codespeak.net hpk at codespeak.net
Wed Aug 24 11:47:55 CEST 2005


Author: hpk
Date: Wed Aug 24 11:47:55 2005
New Revision: 16355

Modified:
   pypy/dist/lib-python/conftest.py
   pypy/dist/pypy/tool/pytest/regrverbose.py
Log:

mirror cpython's regrtest running of tests 
more closely.  this is slightly experimental 
and may break running of tests.  



Modified: pypy/dist/lib-python/conftest.py
==============================================================================
--- pypy/dist/lib-python/conftest.py	(original)
+++ pypy/dist/lib-python/conftest.py	Wed Aug 24 11:47:55 2005
@@ -856,14 +856,14 @@
         pypy_options.extend(
             ['--usemodules=%s' % mod for mod in regrtest.usemodules])
         sopt = " ".join(pypy_options) 
-
-        if regrtest.getoutputpath(): 
-            wrap = str(regr_script)
-        else: 
-            wrap = ""
+        # experimental: always use regrverbose script 
+        # previously we only did it if regrtest.outputpath() was True
+        # the regrverbose script now does the logic that CPython
+        # uses in its regrtest.py 
+        wrap = str(regr_script)
         TIMEOUT = gettimeout()
         cmd = "%s %s %d %s %s %s %s" %(python, alarm_script, TIMEOUT, 
-                pypy_script, wrap, sopt, fspath)
+                pypy_script, sopt, wrap, fspath.purebasename)
         return cmd 
 
     def run(self): 

Modified: pypy/dist/pypy/tool/pytest/regrverbose.py
==============================================================================
--- pypy/dist/pypy/tool/pytest/regrverbose.py	(original)
+++ pypy/dist/pypy/tool/pytest/regrverbose.py	Wed Aug 24 11:47:55 2005
@@ -1,5 +1,13 @@
+# refer to 2.4.1/test/regrtest.py's runtest() for comparison
 import sys
 from test import test_support 
 test_support.verbose = False
 sys.argv[:] = sys.argv[1:]
-execfile(sys.argv[0])
+
+modname = sys.argv[0] 
+impname = 'test.' + modname 
+mod = __import__(impname, globals(), locals(), [modname])
+indirect_test = getattr(mod, 'test_main', None)
+if indirect_test is not None:
+    indirect_test()
+# else the test already ran during import 



More information about the Pypy-commit mailing list