diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index cccb8f7..21dfd71 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -411,7 +411,9 @@ def test_session_testscollected(testdir): def test_funcarg_teardown_failure(testdir): p = testdir.makepyfile(""" - def pytest_funcarg__myarg(request): + import pytest + @pytest.fixture + def myarg(request): def teardown(val): raise ValueError(val) return request.cached_setup(setup=lambda: 42, teardown=teardown, diff --git a/testing/conftest.py b/testing/conftest.py index 70537cd..c10007f 100644 --- a/testing/conftest.py +++ b/testing/conftest.py @@ -37,7 +37,8 @@ def pytest_addoption(parser): help=("add a global test environment, XSpec-syntax. ")) -def pytest_funcarg__specssh(request): +@pytest.fixture +def specssh(request): return getspecssh(request.config) diff --git a/testing/test_remote.py b/testing/test_remote.py index 8192b7d..207b926 100644 --- a/testing/test_remote.py +++ b/testing/test_remote.py @@ -59,7 +59,8 @@ class SlaveSetup: self.slp.sendcommand(name, **kwargs) -def pytest_funcarg__slave(request): +@pytest.fixture +def slave(request): return SlaveSetup(request) diff --git a/testing/test_slavemanage.py b/testing/test_slavemanage.py index 2861329..ac79449 100644 --- a/testing/test_slavemanage.py +++ b/testing/test_slavemanage.py @@ -8,7 +8,8 @@ from xdist.slavemanage import HostRSync, NodeManager pytest_plugins = "pytester" -def pytest_funcarg__hookrecorder(request, config): +@pytest.fixture +def hookrecorder(request, config): hookrecorder = HookRecorder(config.pluginmanager) if hasattr(hookrecorder, "start_recording"): hookrecorder.start_recording(newhooks) @@ -16,11 +17,13 @@ def pytest_funcarg__hookrecorder(request, config): return hookrecorder -def pytest_funcarg__config(testdir): +@pytest.fixture +def config(testdir): return testdir.parseconfig() -def pytest_funcarg__mysetup(tmpdir): +@pytest.fixture +def mysetup(tmpdir): class mysetup: source = tmpdir.mkdir("source") dest = tmpdir.mkdir("dest")