У меня есть эта функция, на которой я хочу создать свой параметрирующий прибор
def make_execution_objects(self, params: dict) -> Iterable:
for action in self.get_all_actions():
exe_object = {'action': action['ref']}
exe_params = self._extract_params(action, params)
if exe_params:
exe_object["parameters"] = exe_params
yield exe_object
, тогда у меня есть 2 прибора в моем файле conftest.py, который выглядит следующим образом
@pytest.fixture()
def actions(st2_tester, marged_json):
return tuple(st2_tester.make_execution_objects(marged_json))
@pytest.fixture(params=actions)
def exe_params(request):
return request.param
но по какой-то причине я получаю TypeError: 'function' object is not iterable
для строки params=actions
.
Я также пытался не возвращать tuple(st2_tester.make_execution_objects(marged_json))
, а просто st2_tester.make_execution_objects(marged_json)
, но все тот же