[pypy-svn] r59212 - in pypy/build/testrunner: . test

pedronis at codespeak.net pedronis at codespeak.net
Sat Oct 18 16:34:29 CEST 2008


Author: pedronis
Date: Sat Oct 18 16:34:29 2008
New Revision: 59212

Modified:
   pypy/build/testrunner/runner.py
   pypy/build/testrunner/test/test_runner.py
Log:
tell which tests are being started



Modified: pypy/build/testrunner/runner.py
==============================================================================
--- pypy/build/testrunner/runner.py	(original)
+++ pypy/build/testrunner/runner.py	Sat Oct 18 16:34:29 2008
@@ -66,6 +66,7 @@
         except IndexError:
             result_queue.put(None) # done
             return
+        result_queue.put(('start', test))
         basename = py.path.local(test).purebasename        
         logfname = sessdir.join("%d-%s-pytest-log" % (num, basename))
         one_output = sessdir.join("%d-%s-output" % (num, basename))
@@ -87,7 +88,7 @@
         if extralog:
             logdata += extralog
 
-        result_queue.put((failure, logdata, output))
+        result_queue.put(('done', test, failure, logdata, output))
 
 invoke_in_thread = thread.start_new_thread
 
@@ -110,7 +111,6 @@
     result_queue =start_workers(N, run_param, testdirs)
 
     done = 0
-    first_ever = True
     while True:
         res = result_queue.get()
         if res is None:
@@ -118,14 +118,17 @@
             if done == N:
                 break
             continue
-                
-        somefailed, logdata, output = res
+
+        if res[0] == 'start':
+            out.write("++ starting %s\n" % res[1]) 
+            continue
+        
+        testname, somefailed, logdata, output = res[1:]
         failure = failure or somefailed
 
-        if first_ever:
-            first_ever = False
-        else:
-            out.write(79*'_'+'\n')
+        heading = "__ %s " % testname
+        
+        out.write(heading + (79-len(heading))*'_'+'\n')
 
         out.write(output)
         if logdata:

Modified: pypy/build/testrunner/test/test_runner.py
==============================================================================
--- pypy/build/testrunner/test/test_runner.py	(original)
+++ pypy/build/testrunner/test/test_runner.py	Sat Oct 18 16:34:29 2008
@@ -154,10 +154,12 @@
 
         out_lines = out.getvalue().splitlines()
 
-        assert len(out_lines) == 1
+        assert len(out_lines) == 3
 
-        assert out_lines[0].startswith("run [")
-        assert "test_normal" in out_lines[0]
+        assert out_lines[0].startswith("++ starting")
+        assert out_lines[2].startswith("run [")
+        for line in out_lines:
+            assert "test_normal" in line
 
     def test_many_dirs(self):
         test_driver = [py.path.local(py.__file__).dirpath('bin', 'py.test')]



More information about the Pypy-commit mailing list