[py-svn] r37881 - in py/trunk/py: doc test test/terminal

fijal at codespeak.net fijal at codespeak.net
Sat Feb 3 19:52:23 CET 2007


Author: fijal
Date: Sat Feb  3 19:52:21 2007
New Revision: 37881

Modified:
   py/trunk/py/doc/TODO.txt
   py/trunk/py/test/collect.py
   py/trunk/py/test/item.py
   py/trunk/py/test/session.py
   py/trunk/py/test/terminal/terminal.py
Log:
Some other stuff goes private


Modified: py/trunk/py/doc/TODO.txt
==============================================================================
--- py/trunk/py/doc/TODO.txt	(original)
+++ py/trunk/py/doc/TODO.txt	Sat Feb  3 19:52:21 2007
@@ -78,7 +78,7 @@
   with help code from py.__.rest.directive.... 
   make sure that the txt files in py/documentation/ use it
 
-* private py.test not-meant-to-be-public API: 
+* (DONE) private py.test not-meant-to-be-public API: 
   here is a rough list what we want public on collectors: 
 
   py.test.collect.Collector.
@@ -90,15 +90,17 @@
         listnames()
         run()
         join()
+        multijoin()
+        name, parent, fspath
         * all collector class properties *
 
   and on py.test.Function|Item (which also has the collector interface):
         execute()
 
-  move all Outcome (Skipped/Passed/...) classes to
+  DONE move all Outcome (Skipped/Passed/...) classes to
   a global place (outcome.py?) 
 
-  all other attributes of collectors shall become private
+  DONE all other attributes of collectors shall become private
 
 * after the above API cleanup there might be more :) 
 

Modified: py/trunk/py/test/collect.py
==============================================================================
--- py/trunk/py/test/collect.py	(original)
+++ py/trunk/py/test/collect.py	Sat Feb  3 19:52:21 2007
@@ -457,7 +457,7 @@
         d = {} 
         # slightly hackish to invoke setup-states on
         # collection ...
-        self.Function.state.prepare(self)
+        self.Function._state.prepare(self)
         for i, x in py.builtin.enumerate(self.obj()): 
             call, args = self.getcallargs(x)
             if not callable(call): 

Modified: py/trunk/py/test/item.py
==============================================================================
--- py/trunk/py/test/item.py	(original)
+++ py/trunk/py/test/item.py	Sat Feb  3 19:52:21 2007
@@ -46,13 +46,13 @@
     """ a Function Item is responsible for setting up  
         and executing a Python callable test object.
     """
-    state = SetupState()
+    _state = SetupState()
     def __init__(self, name, parent, args=(), obj=_dummy, sort_value = None):
         super(Function, self).__init__(name, parent) 
-        self.args = args
+        self._args = args
         if obj is not _dummy: 
             self._obj = obj 
-        self.sort_value = sort_value
+        self._sort_value = sort_value
         
     def __repr__(self): 
         return "<%s %r>" %(self.__class__.__name__, self.name)
@@ -62,13 +62,13 @@
         return code.path, code.firstlineno 
 
     def _getsortvalue(self):  
-        if self.sort_value is None:
+        if self._sort_value is None:
             return self._getpathlineno()
-        return self.sort_value
+        return self._sort_value
 
     def run(self):
-        self.state.prepare(self) 
-        self.execute(self.obj, *self.args)
+        self._state.prepare(self) 
+        self.execute(self.obj, *self._args)
 
     def execute(self, target, *args):
         """ default implementation for calling a test target is to

Modified: py/trunk/py/test/session.py
==============================================================================
--- py/trunk/py/test/session.py	(original)
+++ py/trunk/py/test/session.py	Sat Feb  3 19:52:21 2007
@@ -20,7 +20,7 @@
 
     def footer(self, colitems):
         """ teardown any resources after a test run. """ 
-        py.test.Function.state.teardown_all()
+        py.test.Function._state.teardown_all()
         if not self.config.option.nomagic:
             py.magic.revoke(assertion=1)
 

Modified: py/trunk/py/test/terminal/terminal.py
==============================================================================
--- py/trunk/py/test/terminal/terminal.py	(original)
+++ py/trunk/py/test/terminal/terminal.py	Sat Feb  3 19:52:21 2007
@@ -1,7 +1,6 @@
 import py
 
 from time import time as now
-Item = py.test.Item
 from py.__.test.terminal.out import getout 
 from py.__.test.representation import Presenter
 from py.__.test.outcome import Skipped, Passed, Failed
@@ -91,7 +90,7 @@
             return
         colitem.elapsedtime = end - colitem.start 
         if self.config.option.usepdb:
-            if isinstance(outcome, Item.Failed): 
+            if isinstance(outcome, Failed): 
                 print "dispatching to ppdb", colitem
                 self.repr_failure(colitem, outcome) 
                 import pdb


More information about the py-svn mailing list