changeset 565:50239292c3ad pytest2

pyfunc_call() changed since MoinTestFunction returns function items, needless to use parent obj now.
author pkumar <contactprashantat@gmail.com>
date Wed, 01 Jun 2011 00:44:15 +0530
parents 183deebe0c0b
children b759201f2812
files MoinMoin/conftest.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/conftest.py	Tue May 31 19:47:55 2011 +0530
+++ b/MoinMoin/conftest.py	Wed Jun 01 00:44:15 2011 +0530
@@ -119,10 +119,10 @@
 
 """hook to intercept generators and run them as a single test items"""       
 def pytest_pyfunc_call(pyfuncitem):
-    if inspect.isgeneratorfunction(pyfuncitem.parent.obj):
-        for item in pyfuncitem.parent.obj():
-            item[0](item[1], item[2])
-         #need to stop calls of pyfuncitem in case of generators   
+    if inspect.isgeneratorfunction(pyfuncitem.obj):
+        for item in pyfuncitem.obj():
+            kwarg = item[1:]
+            item[0](*kwarg)           
 
 def pytest_report_header(config):
     return "The tests here are implemented only for pytest-2"