[py-svn] r28304 - py/dist/py/test/terminal

hpk at codespeak.net hpk at codespeak.net
Mon Jun 5 11:09:38 CEST 2006


Author: hpk
Date: Mon Jun  5 11:09:36 2006
New Revision: 28304

Modified:
   py/dist/py/test/terminal/terminal.py
Log:
bail out Armin's controversial rev 23481,
it really hurts in too many cases.  
If neccessary we make it configurable 
(by conftest so that pypy translation, e.g., 
could use the reverse, but i actually think
it would be better to look for other solutions,
like reducing the output or not showing all 
logging output by default etc.) 



Modified: py/dist/py/test/terminal/terminal.py
==============================================================================
--- py/dist/py/test/terminal/terminal.py	(original)
+++ py/dist/py/test/terminal/terminal.py	Mon Jun  5 11:09:36 2006
@@ -252,6 +252,7 @@
             return   # skip the detailed failure reports altogether
         l = self.getitemoutcomepairs(Item.Failed)
         if l: 
+            self.out.sep('_')
             for colitem, outcome in l: 
                 self.repr_failure(colitem, outcome) 
 
@@ -267,11 +268,6 @@
             if ntraceback == traceback:
                 ntraceback = ntraceback.cut(path=path)
             traceback = ntraceback.filter()
-
-        # show the stdout/stderr log before the traceback
-        self.out.sep('_')
-        self.repr_out_err(item)
-
         if not traceback: 
             self.out.line("empty traceback from item %r" % (item,)) 
             return
@@ -302,7 +298,13 @@
             self.out.line("[%s:%d]" %(entry.frame.code.path, entry.lineno+1))  
             self.repr_locals(entry) 
 
-            if entry is not last:
+            # trailing info 
+            if entry == last: 
+                #if item: 
+                #    self.repr_failure_info(item, entry) 
+                self.repr_out_err(item) 
+                self.out.sep("_")
+            else: 
                 self.out.sep("_ ")
                 if index == recursionindex:
                     self.out.line("Recursion detected (same locals & position)")
@@ -336,8 +338,13 @@
                     self.repr_source(source, ' ')
             self.repr_locals(entry) 
 
-            if entry is not last:
-                self.out.sep("_ ")
+            # trailing info 
+            if entry == last: 
+                #if item: 
+                #    self.repr_failure_info(item, entry) 
+                self.repr_out_err(item) 
+                self.out.sep("_")
+            else: 
                 if index == recursionindex:
                     self.out.line("Recursion detected (same locals & position)")
                     self.out.sep("!")
@@ -423,8 +430,6 @@
             for name, obj in zip(['out', 'err'], parent.getouterr()): 
                 if obj: 
                     self.out.sep("- ", "%s: recorded std%s" % (parent.name, name))
-                    if obj.endswith('\n'):
-                        obj = obj[:-1] # avoids an empty line in the common case
                     self.out.line(obj)
             
     def repr_locals(self, entry): 



More information about the pytest-commit mailing list