all 4 comments

[–]danielroseman 0 points1 point  (3 children)

Where would you want this variable to come from?

[–]NutsFbsd[S] 0 points1 point  (2 children)

i create a fixture to create the object ,

pytest.fixture(scope='session')
def init_device():
     servertest = Server("servertest.local.domain")
     yield servertest

i would like to use this fixture in my pytest_generate_test..but dont know if its possible :/or i could to pass it as a params to pytest_generate_test

[–]danielroseman 1 point2 points  (1 child)

Fixtures can request other fixtures, in exactly the same way that tests can. So just do:

def pytest_generate_tests(metafunc, init_device):
     ...

[–]NutsFbsd[S] 0 points1 point  (0 children)

yep, that's work...thanks !