From 8230a39b3906344e2301ec5e88eb858762c97944 Mon Sep 17 00:00:00 2001 From: hpk Date: Thu, 26 Mar 2009 10:16:30 +0100 Subject: [PATCH] [svn r63338] rename pyfuncarg to funcarg --HG-- branch : trunk --- py/conftest.py | 4 ++-- py/execnet/testing/test_gwmanage.py | 4 ++-- py/test/dist/testing/test_nodemanage.py | 4 ++-- py/test/dist/testing/test_txnode.py | 4 ++-- py/test/plugin/pytest_iocapture.py | 4 ++-- py/test/plugin/pytest_plugintester.py | 4 ++-- py/test/plugin/pytest_restdoc.py | 2 +- py/test/plugin/pytest_tmpdir.py | 6 +++--- py/test/pycollect.py | 4 ++-- py/test/testing/test_pickling.py | 2 +- py/test/testing/test_pycollect.py | 26 ++++++++++++------------- py/test/testing/test_traceback.py | 2 +- 12 files changed, 33 insertions(+), 33 deletions(-) diff --git a/py/conftest.py b/py/conftest.py index 9f5cc84a6..b27b5e5d0 100644 --- a/py/conftest.py +++ b/py/conftest.py @@ -3,9 +3,9 @@ rsyncignore = ['c-extension/greenlet/build'] import py class PylibTestconfigPlugin: - def pytest_pyfuncarg_specssh(self, pyfuncitem): + def pytest_funcarg_specssh(self, pyfuncitem): return getspecssh(pyfuncitem.config) - def pytest_pyfuncarg_specsocket(self, pyfuncitem): + def pytest_funcarg_specsocket(self, pyfuncitem): return getsocketspec(pyfuncitem.config) def pytest_addoption(self, parser): diff --git a/py/execnet/testing/test_gwmanage.py b/py/execnet/testing/test_gwmanage.py index 1c5f6465b..409e3453b 100644 --- a/py/execnet/testing/test_gwmanage.py +++ b/py/execnet/testing/test_gwmanage.py @@ -111,9 +111,9 @@ class TestGatewayManagerPopen: assert l[0].startswith(curwd) assert l[0].endswith("hello") -def pytest_pyfuncarg_source(pyfuncitem): +def pytest_funcarg_source(pyfuncitem): return py.test.ensuretemp(pyfuncitem.getmodpath()).mkdir("source") -def pytest_pyfuncarg_dest(pyfuncitem): +def pytest_funcarg_dest(pyfuncitem): return py.test.ensuretemp(pyfuncitem.getmodpath()).mkdir("dest") class TestHRSync: diff --git a/py/test/dist/testing/test_nodemanage.py b/py/test/dist/testing/test_nodemanage.py index b23b48cf0..da65b2cc2 100644 --- a/py/test/dist/testing/test_nodemanage.py +++ b/py/test/dist/testing/test_nodemanage.py @@ -7,9 +7,9 @@ from py.__.test.dist.nodemanage import NodeManager from py.__.test import event -def pytest_pyfuncarg_source(pyfuncitem): +def pytest_funcarg_source(pyfuncitem): return py.test.ensuretemp(pyfuncitem.getmodpath()).mkdir("source") -def pytest_pyfuncarg_dest(pyfuncitem): +def pytest_funcarg_dest(pyfuncitem): dest = py.test.ensuretemp(pyfuncitem.getmodpath()).mkdir("dest") return dest diff --git a/py/test/dist/testing/test_txnode.py b/py/test/dist/testing/test_txnode.py index 83392f057..a4c23fb46 100644 --- a/py/test/dist/testing/test_txnode.py +++ b/py/test/dist/testing/test_txnode.py @@ -54,12 +54,12 @@ class MySetup: print "exiting:", gw gw.exit() -def pytest_pyfuncarg_mysetup(pyfuncitem): +def pytest_funcarg_mysetup(pyfuncitem): mysetup = MySetup(pyfuncitem) pyfuncitem.addfinalizer(mysetup.finalize) return mysetup -def pytest_pyfuncarg_testdir(__call__, pyfuncitem): +def pytest_funcarg_testdir(__call__, pyfuncitem): # decorate to make us always change to testdir testdir = __call__.execute(firstresult=True) testdir.chdir() diff --git a/py/test/plugin/pytest_iocapture.py b/py/test/plugin/pytest_iocapture.py index ec6e6807b..d8a6b45b7 100644 --- a/py/test/plugin/pytest_iocapture.py +++ b/py/test/plugin/pytest_iocapture.py @@ -2,12 +2,12 @@ import py class IocapturePlugin: """ capture sys.stdout/sys.stderr / fd1/fd2. """ - def pytest_pyfuncarg_stdcapture(self, pyfuncitem): + def pytest_funcarg_stdcapture(self, pyfuncitem): capture = Capture(py.io.StdCapture) pyfuncitem.addfinalizer(capture.finalize) return capture - def pytest_pyfuncarg_stdcapturefd(self, pyfuncitem): + def pytest_funcarg_stdcapturefd(self, pyfuncitem): capture = Capture(py.io.StdCaptureFD) pyfuncitem.addfinalizer(capture.finalize) return capture diff --git a/py/test/plugin/pytest_plugintester.py b/py/test/plugin/pytest_plugintester.py index fba4ca298..6af64b20c 100644 --- a/py/test/plugin/pytest_plugintester.py +++ b/py/test/plugin/pytest_plugintester.py @@ -5,7 +5,7 @@ import py class PlugintesterPlugin: """ test support code for testing pytest plugins. """ - def pytest_pyfuncarg_plugintester(self, pyfuncitem): + def pytest_funcarg_plugintester(self, pyfuncitem): pt = PluginTester(pyfuncitem) pyfuncitem.addfinalizer(pt.finalize) return pt @@ -46,7 +46,7 @@ class PluginTester(Support): getargs = py.std.inspect.getargs def isgenerichook(name): - return name.startswith("pytest_pyfuncarg_") + return name.startswith("pytest_funcarg_") while methods: name, method = methods.popitem() diff --git a/py/test/plugin/pytest_restdoc.py b/py/test/plugin/pytest_restdoc.py index 362180fc0..7ba0268c0 100644 --- a/py/test/plugin/pytest_restdoc.py +++ b/py/test/plugin/pytest_restdoc.py @@ -328,7 +328,7 @@ class TestApigenLinkRole: "resolve_linkrole('source', 'py/foo/bar.py')") -def pytest_pyfuncarg_testdir(__call__, pyfuncitem): +def pytest_funcarg_testdir(__call__, pyfuncitem): testdir = __call__.execute(firstresult=True) testdir.makepyfile(confrest="from py.__.misc.rest import Project") testdir.plugins.append(RestdocPlugin()) diff --git a/py/test/plugin/pytest_tmpdir.py b/py/test/plugin/pytest_tmpdir.py index 3b328c871..891fce1c9 100644 --- a/py/test/plugin/pytest_tmpdir.py +++ b/py/test/plugin/pytest_tmpdir.py @@ -13,7 +13,7 @@ class TmpdirPlugin: """ provide temporary directories to test functions and methods. """ - def pytest_pyfuncarg_tmpdir(self, pyfuncitem): + def pytest_funcarg_tmpdir(self, pyfuncitem): name = pyfuncitem.name return pyfuncitem.config.mktemp(name, numbered=True) @@ -26,10 +26,10 @@ class TmpdirPlugin: def test_generic(plugintester): plugintester.apicheck(TmpdirPlugin) -def test_pyfuncarg(testdir): +def test_funcarg(testdir): item = testdir.getitem("def test_func(tmpdir): pass") plugin = TmpdirPlugin() - p = plugin.pytest_pyfuncarg_tmpdir(item) + p = plugin.pytest_funcarg_tmpdir(item) assert p.check() bn = p.basename.strip("0123456789-") assert bn.endswith("test_func") diff --git a/py/test/pycollect.py b/py/test/pycollect.py index cbe680f82..12e2f4f7b 100644 --- a/py/test/pycollect.py +++ b/py/test/pycollect.py @@ -375,7 +375,7 @@ class Function(FunctionMixin, py.test.collect.Item): return kwargs def lookup_onearg(self, argname): - prefix = "pytest_pyfuncarg_" + prefix = "pytest_funcarg_" try: makerlist = self.config._getmakerlist(argname) except KeyError: @@ -390,7 +390,7 @@ class Function(FunctionMixin, py.test.collect.Item): else: self._raisefuncargerror(argname, prefix) - def _raisefuncargerror(self, argname, prefix="pytest_pyfuncarg_"): + def _raisefuncargerror(self, argname, prefix="pytest_funcarg_"): metainfo = self.repr_metainfo() available = [] plugins = self.config.pytestplugins._plugins.values() diff --git a/py/test/testing/test_pickling.py b/py/test/testing/test_pickling.py index 61b3047c1..84a9f3262 100644 --- a/py/test/testing/test_pickling.py +++ b/py/test/testing/test_pickling.py @@ -1,6 +1,6 @@ import py -def pytest_pyfuncarg_pickletransport(pyfuncitem): +def pytest_funcarg_pickletransport(pyfuncitem): return ImmutablePickleTransport() def pytest_pyfunc_call(__call__, pyfuncitem, args, kwargs): diff --git a/py/test/testing/test_pycollect.py b/py/test/testing/test_pycollect.py index 0e23a7d34..cbebb3c3c 100644 --- a/py/test/testing/test_pycollect.py +++ b/py/test/testing/test_pycollect.py @@ -249,10 +249,10 @@ class TestFunction: assert f1 == f1_b assert not f1 != f1_b - def test_pyfuncarg_lookupfails(self, testdir): + def test_funcarg_lookupfails(self, testdir): testdir.makeconftest(""" class ConftestPlugin: - def pytest_pyfuncarg_something(self, pyfuncitem): + def pytest_funcarg_something(self, pyfuncitem): return 42 """) item = testdir.getitem("def test_func(some): pass") @@ -260,19 +260,19 @@ class TestFunction: s = str(exc.value) assert s.find("something") != -1 - def test_pyfuncarg_lookup_default(self, testdir): + def test_funcarg_lookup_default(self, testdir): item = testdir.getitem("def test_func(some, other=42): pass") class Provider: - def pytest_pyfuncarg_some(self, pyfuncitem): + def pytest_funcarg_some(self, pyfuncitem): return pyfuncitem.name item.config.pytestplugins.register(Provider()) kw = item.lookup_allargs() assert len(kw) == 1 - def test_pyfuncarg_lookup_default_gets_overriden(self, testdir): + def test_funcarg_lookup_default_gets_overriden(self, testdir): item = testdir.getitem("def test_func(some=42, other=13): pass") class Provider: - def pytest_pyfuncarg_other(self, pyfuncitem): + def pytest_funcarg_other(self, pyfuncitem): return pyfuncitem.name item.config.pytestplugins.register(Provider()) kw = item.lookup_allargs() @@ -281,12 +281,12 @@ class TestFunction: assert name == "other" assert value == item.name - def test_pyfuncarg_basic(self, testdir): + def test_funcarg_basic(self, testdir): item = testdir.getitem("def test_func(some, other): pass") class Provider: - def pytest_pyfuncarg_some(self, pyfuncitem): + def pytest_funcarg_some(self, pyfuncitem): return pyfuncitem.name - def pytest_pyfuncarg_other(self, pyfuncitem): + def pytest_funcarg_other(self, pyfuncitem): return 42 item.config.pytestplugins.register(Provider()) kw = item.lookup_allargs() @@ -294,11 +294,11 @@ class TestFunction: assert kw['some'] == "test_func" assert kw['other'] == 42 - def test_pyfuncarg_addfinalizer(self, testdir): + def test_funcarg_addfinalizer(self, testdir): item = testdir.getitem("def test_func(some): pass") l = [] class Provider: - def pytest_pyfuncarg_some(self, pyfuncitem): + def pytest_funcarg_some(self, pyfuncitem): pyfuncitem.addfinalizer(lambda: l.append(42)) return 3 item.config.pytestplugins.register(Provider()) @@ -310,9 +310,9 @@ class TestFunction: assert len(l) == 1 assert l[0] == 42 - def test_pyfuncarg_lookup_modulelevel(self, testdir): + def test_funcarg_lookup_modulelevel(self, testdir): modcol = testdir.getmodulecol(""" - def pytest_pyfuncarg_something(pyfuncitem): + def pytest_funcarg_something(pyfuncitem): return pyfuncitem.name class TestClass: diff --git a/py/test/testing/test_traceback.py b/py/test/testing/test_traceback.py index 2527aaa90..988dbb21b 100644 --- a/py/test/testing/test_traceback.py +++ b/py/test/testing/test_traceback.py @@ -10,7 +10,7 @@ class TestTracebackCutting: def test_traceback_argsetup(self, testdir): testdir.makeconftest(""" class ConftestPlugin: - def pytest_pyfuncarg_hello(self, pyfuncitem): + def pytest_funcarg_hello(self, pyfuncitem): raise ValueError("xyz") """) p = testdir.makepyfile("def test(hello): pass")