From 5914277f92aabc5646758c67172180f4a53d30f6 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Wed, 30 Sep 2009 12:59:47 +0200 Subject: [PATCH] internally rename "provider" to "factory" to be consistent with documentation. --HG-- branch : trunk --- py/test/funcargs.py | 12 ++++++------ testing/pytest/test_funcargs.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/py/test/funcargs.py b/py/test/funcargs.py index 4842aa40f..4f9d6df68 100644 --- a/py/test/funcargs.py +++ b/py/test/funcargs.py @@ -95,7 +95,7 @@ class FuncargRequest: if self.instance is not None: self._plugins.append(self.instance) self._funcargs = self._pyfuncitem.funcargs.copy() - self._provider = {} + self._name2factory = {} self._currentarg = None def _fillfuncargs(self): @@ -138,19 +138,19 @@ class FuncargRequest: return self._funcargs[argname] except KeyError: pass - if argname not in self._provider: - self._provider[argname] = self.config.pluginmanager.listattr( + if argname not in self._name2factory: + self._name2factory[argname] = self.config.pluginmanager.listattr( plugins=self._plugins, attrname=self._argprefix + str(argname) ) #else: we are called recursively - if not self._provider[argname]: + if not self._name2factory[argname]: self._raiselookupfailed(argname) - funcargprovider = self._provider[argname].pop() + funcargfactory = self._name2factory[argname].pop() oldarg = self._currentarg self._currentarg = argname try: - self._funcargs[argname] = res = funcargprovider(request=self) + self._funcargs[argname] = res = funcargfactory(request=self) finally: self._currentarg = oldarg return res diff --git a/testing/pytest/test_funcargs.py b/testing/pytest/test_funcargs.py index 689224fcc..144f0c1f8 100644 --- a/testing/pytest/test_funcargs.py +++ b/testing/pytest/test_funcargs.py @@ -115,7 +115,7 @@ class TestRequest: assert req.cls.__name__ == "TestB" assert req.instance.__class__ == req.cls - def XXXtest_request_contains_funcargs_provider(self, testdir): + def XXXtest_request_contains_funcarg_name2factory(self, testdir): modcol = testdir.getmodulecol(""" def pytest_funcarg__something(request): pass @@ -125,9 +125,9 @@ class TestRequest: """) item1, = testdir.genitems([modcol]) assert item1.name == "test_method" - provider = funcargs.FuncargRequest(item1)._provider - assert len(provider) == 1 - assert provider[0].__name__ == "pytest_funcarg__something" + name2factory = funcargs.FuncargRequest(item1)._name2factory + assert len(name2factory) == 1 + assert name2factory[0].__name__ == "pytest_funcarg__something" def test_getfuncargvalue_recursive(self, testdir): testdir.makeconftest("""