[py-svn] r11455 - py/dist/py/test

hpk at codespeak.net hpk at codespeak.net
Tue Apr 26 12:32:28 CEST 2005


Author: hpk
Date: Tue Apr 26 12:32:28 2005
New Revision: 11455

Modified:
   py/dist/py/test/item.py
   py/dist/py/test/session.py
Log:
move setup/teardown to the Function test item.  



Modified: py/dist/py/test/item.py
==============================================================================
--- py/dist/py/test/item.py	(original)
+++ py/dist/py/test/item.py	Tue Apr 26 12:32:28 2005
@@ -30,12 +30,13 @@
             self.stack.append(col) 
 
 class Item(py.test.collect.Collector): 
-    state = SetupState()
+    pass
 
 class Function(Item): 
     """ a Function Item is responsible for setting up  
         and executing a Python callable test object.
     """
+    state = SetupState()
     def __init__(self, name, parent, args=(), obj=_dummy):
         self.name = name 
         self.parent = parent 

Modified: py/dist/py/test/session.py
==============================================================================
--- py/dist/py/test/session.py	(original)
+++ py/dist/py/test/session.py	Tue Apr 26 12:32:28 2005
@@ -20,7 +20,7 @@
 
     def footer(self, colitems):
         """ teardown any resources we know about. """
-        py.test.Item.state.teardown_all()
+        py.test.Function.state.teardown_all()
         if not self.config.option.nomagic:
             py.magic.revoke(assertion=1)
 



More information about the pytest-commit mailing list