fix aimed at passing jstests functional tests: allow to have _fillfuncargs() called even for non-pycollect-object test-items.

--HG--
branch : trunk
This commit is contained in:
holger krekel
2009-12-30 14:05:41 +01:00
parent 89f178bf4d
commit 30bbf3b042
4 changed files with 37 additions and 15 deletions

View File

@@ -15,6 +15,16 @@ def fillfuncargs(function):
request = FuncargRequest(pyfuncitem=function)
request._fillfuncargs()
def getplugins(node, withpy=False): # might by any node
plugins = node.config._getmatchingplugins(node.fspath)
if withpy:
mod = node.getparent(py.test.collect.Module)
if mod is not None:
plugins.append(mod.obj)
inst = node.getparent(py.test.collect.Instance)
if inst is not None:
plugins.append(inst.obj)
return plugins
_notexists = object()
class CallSpec:
@@ -93,7 +103,7 @@ class FuncargRequest:
self.fspath = pyfuncitem.fspath
if hasattr(pyfuncitem, '_requestparam'):
self.param = pyfuncitem._requestparam
self._plugins = pyfuncitem._getplugins(withpy=True)
self._plugins = getplugins(pyfuncitem, withpy=True)
self._funcargs = self._pyfuncitem.funcargs.copy()
self._name2factory = {}
self._currentarg = None