[py-svn] r37239 - in py/branch/config/py: code test/terminal

fijal at codespeak.net fijal at codespeak.net
Tue Jan 23 23:38:47 CET 2007


Author: fijal
Date: Tue Jan 23 23:38:45 2007
New Revision: 37239

Modified:
   py/branch/config/py/code/representation.py
   py/branch/config/py/test/terminal/terminal.py
Log:
Move minor function from terminal to representation


Modified: py/branch/config/py/code/representation.py
==============================================================================
--- py/branch/config/py/code/representation.py	(original)
+++ py/branch/config/py/code/representation.py	Tue Jan 23 23:38:45 2007
@@ -68,3 +68,11 @@
         self.out.line('>' + indent[:-1] + lines.pop(0))
         for x in lines:
             self.out.line(indent + x)
+
+    def getentrysource(self, entry):
+        try:
+            source = entry.getsource()
+        except py.error.ENOENT:
+            source = py.code.Source("[failure to get at sourcelines from %r]\n" % entry)
+        return source.deindent()
+

Modified: py/branch/config/py/test/terminal/terminal.py
==============================================================================
--- py/branch/config/py/test/terminal/terminal.py	(original)
+++ py/branch/config/py/test/terminal/terminal.py	Tue Jan 23 23:38:45 2007
@@ -290,7 +290,7 @@
                     self.out.line()
             else: 
                 self.out.line("")
-            source = self.getentrysource(entry)
+            source = self.presenter.getentrysource(entry)
             firstsourceline = entry.getfirstlinesource()
             marker_location = entry.lineno - firstsourceline
             if entry == last: 
@@ -300,7 +300,7 @@
                 self.presenter.repr_source(source, '>', marker_location)
             self.out.line("") 
             self.out.line("[%s:%d]" %(entry.frame.code.path, entry.lineno+1))  
-            self.repr_locals(entry) 
+            #self.repr_locals(entry) 
 
             # trailing info 
             if entry == last: 
@@ -357,13 +357,6 @@
     # the following is only used by the combination '--pdb --tb=no'
     repr_failure_tbno = repr_failure_tbshort
 
-    def getentrysource(self, entry):
-        try:
-            source = entry.getsource()
-        except py.error.ENOENT:
-            source = py.code.Source("[failure to get at sourcelines from %r]\n" % entry)
-        return source.deindent()
-
     def repr_out_err(self, colitem): 
         for parent in colitem.listchain(): 
             for name, obj in zip(['out', 'err'], parent.getouterr()): 



More information about the pytest-commit mailing list