[pypy-svn] r11775 - pypy/dist/lib-python

hpk at codespeak.net hpk at codespeak.net
Mon May 2 12:39:51 CEST 2005


Author: hpk
Date: Mon May  2 12:39:50 2005
New Revision: 11775

Modified:
   pypy/dist/lib-python/conftest.py
Log:
- for fine grained output tests switch test_support.verbose off, 
  i don't see an easy way of doing the same for coarse-grained 
  short of copying the whole test_support to modified and globally
  switching it off 

- added a '-N' noncore option which selects non-core tests




Modified: pypy/dist/lib-python/conftest.py
==============================================================================
--- pypy/dist/lib-python/conftest.py	(original)
+++ pypy/dist/lib-python/conftest.py	Mon May  2 12:39:50 2005
@@ -43,6 +43,9 @@
     Option('-A', '--all', action="store_true", 
            default=False, dest="withall", 
            help="include all tests (instead of just core tests)."), 
+    Option('-N', '--noncore', action="store_true", 
+           default=False, dest="noncore", 
+           help="include only non-core tests"), 
     Option('-E', '--extracttests', action="store_true", 
            default=False, dest="extracttests", 
            help="try to extract single tests and run them via py.test/PyPy"), 
@@ -314,7 +317,19 @@
         if p.check(file=1): 
             return p 
 
+    def _prepare(self, space): 
+        # output tests sometimes depend on not running in
+        # verbose mode 
+        if not hasattr(self, '_prepared'): 
+            if self.getoutputpath(): 
+                space.appexec([], """(): 
+                    from test import test_support
+                    test_support.verbose = False
+            """)
+            self._prepared = True
+            
     def run_file(self, space): 
+        self._prepare(space)
         fspath = self.getfspath()
         assert fspath.check()
         if self.oldstyle or pypy_option.oldstyle: 
@@ -714,8 +729,12 @@
         return cache.get(name, None)
         
     def run(self): 
-        return [x.basename for x in self.testmap 
-                    if x.core or pypy_option.withall]
+        l = []
+        for x in self.testmap: 
+            print x.core
+            if ((not not x.core) ^ (pypy_option.noncore)) or pypy_option.withall: 
+                l.append(x.basename) 
+        return l 
 
     def join(self, name): 
         regrtest = self.get(name) 



More information about the Pypy-commit mailing list