[py-svn] r8325 - in py/dist/py/test: . testing

hpk at codespeak.net hpk at codespeak.net
Mon Jan 17 00:13:29 CET 2005


Author: hpk
Date: Mon Jan 17 00:13:28 2005
New Revision: 8325

Modified:
   py/dist/py/test/item.py
   py/dist/py/test/testing/test_api.py
Log:
ups ... 


Modified: py/dist/py/test/item.py
==============================================================================
--- py/dist/py/test/item.py	(original)
+++ py/dist/py/test/item.py	Mon Jan 17 00:13:28 2005
@@ -165,7 +165,7 @@
 def skip_on_error(func, *args, **kwargs): 
     """ skip test if the given call fails. """
     try:
-        func(*args, **kwargs)
+        return func(*args, **kwargs)
     except Exception, e:
         s = py.code.ExceptionInfo().exconly() 
         name = getattr(func, '__name__', func) 

Modified: py/dist/py/test/testing/test_api.py
==============================================================================
--- py/dist/py/test/testing/test_api.py	(original)
+++ py/dist/py/test/testing/test_api.py	Mon Jan 17 00:13:28 2005
@@ -9,3 +9,8 @@
                 "py.test.skip_on_error(f)")
     print excinfo
     assert str(excinfo).find("ValueError") != -1 
+
+def test_skip_on_error_with_no_failure():
+    def f():
+        return 42 
+    assert py.test.skip_on_error(f) == 42 



More information about the pytest-commit mailing list