[py-svn] r8414 - py/dist/py/test/report/text

hpk at codespeak.net hpk at codespeak.net
Wed Jan 19 14:19:40 CET 2005


Author: hpk
Date: Wed Jan 19 14:19:40 2005
New Revision: 8414

Modified:
   py/dist/py/test/report/text/summary.py
Log:
for tracebacks longer than one entry print the
original failing test at the very end of the traceback. 
(especially useful for long tracebacks i think) 



Modified: py/dist/py/test/report/text/summary.py
==============================================================================
--- py/dist/py/test/report/text/summary.py	(original)
+++ py/dist/py/test/report/text/summary.py	Wed Jan 19 14:19:40 2005
@@ -86,9 +86,15 @@
             if res: 
                 self.repr_out_err(res) 
             if entry == last: 
+                if res: 
+                    fn, lineno = res.item.extpy.getfilelineno() 
+                    if (fn != entry.frame.code.path or 
+                        entry.frame.code.firstlineno != lineno): 
+                        self.out.line("[test was: %s:%d]" % (fn, lineno))
                 self.out.sep("_")
             else: 
                 self.out.sep("_ ")
+                                                
 
     def repr_source(self, entry, marker=">"): 
         try: 



More information about the pytest-commit mailing list