[py-svn] r57262 - in py/branch/event/py/test2: . testing

hpk at codespeak.net hpk at codespeak.net
Fri Aug 15 09:01:58 CEST 2008


Author: hpk
Date: Fri Aug 15 09:01:56 2008
New Revision: 57262

Modified:
   py/branch/event/py/test2/collect.py
   py/branch/event/py/test2/pycollect.py
   py/branch/event/py/test2/runner.py
   py/branch/event/py/test2/testing/test_doctest.py
   py/branch/event/py/test2/testing/test_runner_functional.py
Log:
rename getfailurerepr to repr_failure 


Modified: py/branch/event/py/test2/collect.py
==============================================================================
--- py/branch/event/py/test2/collect.py	(original)
+++ py/branch/event/py/test2/collect.py	Fri Aug 15 09:01:56 2008
@@ -220,7 +220,7 @@
         col = config.getfsnode(fspath)
         return col._getitembynames(names)
 
-    def _getfailurerepr_py(self, excinfo, outerr):
+    def _repr_failure_py(self, excinfo, outerr):
         excinfo.traceback = self._prunetraceback(excinfo.traceback)
         repr = excinfo.getrepr(funcargs=True, 
                                showlocals=self._config.option.showlocals)
@@ -229,7 +229,7 @@
                 repr.addsection("Captured std%s" % secname, content.rstrip())
         return repr 
 
-    getfailurerepr = _getfailurerepr_py
+    repr_failure = _repr_failure_py
 
     shortfailurerepr = "F"
 
@@ -269,8 +269,8 @@
         """
         raise NotImplementedError("abstract")
 
-    def getfailurerepr(self, excinfo, outerr):
-        return self._getfailurerepr_py(excinfo, outerr)
+    def repr_failure(self, excinfo, outerr):
+        return self._repr_failure_py(excinfo, outerr)
 
 class FSCollector(Collector): 
     def __init__(self, fspath, parent=None, config=None): 

Modified: py/branch/event/py/test2/pycollect.py
==============================================================================
--- py/branch/event/py/test2/pycollect.py	(original)
+++ py/branch/event/py/test2/pycollect.py	Fri Aug 15 09:01:56 2008
@@ -216,8 +216,8 @@
             traceback = ntraceback.filter()
         return traceback 
 
-    def getfailurerepr(self, excinfo, outerr):
-        return self._getfailurerepr_py(excinfo, outerr)
+    def repr_failure(self, excinfo, outerr):
+        return self._repr_failure_py(excinfo, outerr)
 
     shortfailurerepr = "F"
 
@@ -286,7 +286,7 @@
         self.reprlocation.toterminal(tw)
              
 class DoctestFileContent(Item):
-    def getfailurerepr(self, excinfo, outerr):
+    def repr_failure(self, excinfo, outerr):
         if excinfo.errisinstance(py.compat.doctest.DocTestFailure):
             doctestfailure = excinfo.value
             example = doctestfailure.example
@@ -308,7 +308,7 @@
             return ReprFailDoctest(reprlocation, lines)
         #elif excinfo.errisinstance(py.compat.doctest.UnexpectedException):
         else: 
-            return super(DoctestFileContent, self).getfailurerepr(excinfo, outerr)
+            return super(DoctestFileContent, self).repr_failure(excinfo, outerr)
             
     def execute(self):
         failed, tot = py.compat.doctest.testfile(

Modified: py/branch/event/py/test2/runner.py
==============================================================================
--- py/branch/event/py/test2/runner.py	(original)
+++ py/branch/event/py/test2/runner.py	Fri Aug 15 09:01:56 2008
@@ -55,10 +55,10 @@
         else:
             outcome = "failed"
             if when == "execute":
-                longrepr = self.colitem.getfailurerepr(excinfo, outerr)
+                longrepr = self.colitem.repr_failure(excinfo, outerr)
                 shortrepr = self.colitem.shortfailurerepr
             else:
-                longrepr = self.colitem._getfailurerepr_py(excinfo, outerr)
+                longrepr = self.colitem._repr_failure_py(excinfo, outerr)
                 shortrepr = self.colitem.shortfailurerepr.lower()
         kw = { outcome: OutcomeRepr(when, shortrepr, longrepr)}
         return kw

Modified: py/branch/event/py/test2/testing/test_doctest.py
==============================================================================
--- py/branch/event/py/test2/testing/test_doctest.py	(original)
+++ py/branch/event/py/test2/testing/test_doctest.py	Fri Aug 15 09:01:56 2008
@@ -27,5 +27,5 @@
     """))
     testitem = py.test.collect.DoctestFile(p).join(p.basename)
     excinfo = py.test.raises(Failed, "testitem.execute()")
-    repr = testitem.getfailurerepr(excinfo, ("", ""))
+    repr = testitem.repr_failure(excinfo, ("", ""))
     assert repr.reprlocation 

Modified: py/branch/event/py/test2/testing/test_runner_functional.py
==============================================================================
--- py/branch/event/py/test2/testing/test_runner_functional.py	(original)
+++ py/branch/event/py/test2/testing/test_runner_functional.py	Fri Aug 15 09:01:56 2008
@@ -93,7 +93,7 @@
         self.makepyfile(conftest="""
             import py
             class Function(py.test2.collect.Function):
-                def getfailurerepr(self, excinfo, outerr):
+                def repr_failure(self, excinfo, outerr):
                     return "hello" 
         """)
         ev = self.runitem("""
@@ -113,7 +113,7 @@
         self.makepyfile(conftest="""
             import py
             class Function(py.test2.collect.Function):
-                def getfailurerepr(self, excinfo):
+                def repr_failure(self, excinfo):
                     assert 0
         """)
         ev = self.runitem("""



More information about the pytest-commit mailing list