diff --git a/testinfra/plugin.py b/testinfra/plugin.py index 57b62207..90bdc8a0 100644 --- a/testinfra/plugin.py +++ b/testinfra/plugin.py @@ -66,6 +66,11 @@ def TestinfraBackend(host): return host.backend +@pytest.fixture(scope="module") +def _testinfra_host(request): + return request.param + + @pytest.fixture(scope="module") def host(_testinfra_host): return _testinfra_host @@ -149,7 +154,7 @@ def pytest_generate_tests(metafunc): params = sorted(params, key=lambda x: x.backend.get_pytest_id()) ids = [e.backend.get_pytest_id() for e in params] metafunc.parametrize( - "_testinfra_host", params, ids=ids, scope="module") + "_testinfra_host", params, ids=ids, scope="module", indirect=True) def pytest_collection_finish(session):