[py-svn] r38398 - py/trunk/py/test/rsession

hpk at codespeak.net hpk at codespeak.net
Sat Feb 10 18:00:59 CET 2007


Author: hpk
Date: Sat Feb 10 18:00:58 2007
New Revision: 38398

Modified:
   py/trunk/py/test/rsession/executor.py
Log:
for setup/teardown pairs the correct idiom is

    setup()
    try:
        ...
    finally:
        teardown()

and not to do the setup() within the try, 
because if that raises, teardown() will
likely go wrong as well etc.


Modified: py/trunk/py/test/rsession/executor.py
==============================================================================
--- py/trunk/py/test/rsession/executor.py	(original)
+++ py/trunk/py/test/rsession/executor.py	Sat Feb 10 18:00:58 2007
@@ -22,8 +22,8 @@
 
     def run(self, capture=True):
         if capture:
+            self.item.startcapture()
             try:
-                self.item.startcapture()
                 self.item.run()
             finally:
                 self.item.finishcapture()



More information about the pytest-commit mailing list