Skip to content

Commit 625e072

Browse files
committed
hosts: make setup_host a nested func
Will allow it to access host_list through closure. Signed-off-by: Yann Dirson <[email protected]>
1 parent 9f486f1 commit 625e072

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ def pytest_runtest_makereport(item, call):
140140

141141
# fixtures
142142

143-
def setup_host(hostname_or_ip):
144-
pool = Pool(hostname_or_ip)
145-
h = pool.master
146-
return h
147-
148143
@pytest.fixture(scope='session')
149144
def hosts(pytestconfig):
145+
def setup_host(hostname_or_ip):
146+
pool = Pool(hostname_or_ip)
147+
h = pool.master
148+
return h
149+
150150
# a list of master hosts, each from a different pool
151151
hosts_args = pytestconfig.getoption("hosts")
152152
hosts_split = [hostlist.split(',') for hostlist in hosts_args]

0 commit comments

Comments
 (0)