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

arigo at codespeak.net arigo at codespeak.net
Sun May 8 23:55:24 CEST 2005


Author: arigo
Date: Sun May  8 23:55:24 2005
New Revision: 12094

Modified:
   pypy/dist/lib-python/conftest.py
   pypy/dist/pypy/tool/pytest/htmlreport.py
   pypy/dist/pypy/tool/pytest/overview.py
Log:
Use the same logic in conftest.py to select ok/error/timeout tests as in the web page.
Put this logic in overview.py.
This makes which tests are actually selected predictable (for example there are now a
lot of timed-out tests checked in later than the revision selected on the web page,
which means that it took me a long time to figure out why -kerror was only selecting
three tests from the lot...).

Modified: pypy/dist/lib-python/conftest.py
==============================================================================
--- pypy/dist/lib-python/conftest.py	(original)
+++ pypy/dist/lib-python/conftest.py	Sun May  8 23:55:24 2005
@@ -801,9 +801,12 @@
             from pypy.tool.pytest.overview import ResultCache
             self.__class__._resultcache = rc = ResultCache() 
             rc.parselatest()
-        result = self._resultcache.getlatest(self.fspath.purebasename, 
-                                             **{keyword:True})
-        return result is not None 
+        result = self._resultcache.getlatestrelevant(self.fspath.purebasename)
+        if not result: return False
+        if keyword == 'timeout': return result.istimeout()
+        if keyword == 'error': return result.iserror()
+        if keyword == 'ok': return result.isok()
+        assert False, "should not be there" 
 
     def getinvocation(self, regrtest): 
         fspath = regrtest.getfspath() 

Modified: pypy/dist/pypy/tool/pytest/htmlreport.py
==============================================================================
--- pypy/dist/pypy/tool/pytest/htmlreport.py	(original)
+++ pypy/dist/pypy/tool/pytest/htmlreport.py	Sun May  8 23:55:24 2005
@@ -90,9 +90,7 @@
         coretests = []
         noncoretests = [] 
         for name in self.resultcache.getnames(): 
-            result = self.resultcache.getlatest(name, error=1, ok=1)
-            if not result: 
-                result = self.resultcache.getlatest(name) 
+            result = self.resultcache.getlatestrelevant(name)
             if iscore(result): 
                 coretests.append(result)
             else: 

Modified: pypy/dist/pypy/tool/pytest/overview.py
==============================================================================
--- pypy/dist/pypy/tool/pytest/overview.py	(original)
+++ pypy/dist/pypy/tool/pytest/overview.py	Sun May  8 23:55:24 2005
@@ -48,3 +48,7 @@
             maxrev = resrev 
             maxresult = res 
         return maxresult 
+
+    def getlatestrelevant(self, name):
+        # get the latest revision that did not time out.
+        return self.getlatest(name, error=1, ok=1) or self.getlatest(name)



More information about the Pypy-commit mailing list