'is it possible that use simultaneously params and autouse in pytest.fixture

E.g.

@pytest.fixture(scope='class', params=['zhangsan', 'lisi', 'lala'], autouse=True)
def my_fixture(request):
    return request.param

class Test1():
  def test_02_login1(self):
      print('login2')
      print('---------' + str(my_fixture))

But I know that will lead to print the address of "myfixture" function, how to fix this question?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source