我正在尝试编写测试功能。
import pytest
@pytest.fixture(passed_list)
def test_search_through(last_state):
# Here I want iteration through the passed_list as follows
# last_state = passed_list[0], then last_state = passed_list[1], last_state = passed_list[2] etc. without loop
# and depending on what will I get in last_state do some stuff
if last_state == .... :
# .... do something
elif last_state == ....:
# .... do something
elif last_state == ....:
# .... do something
如何在这种情况下传递一个列表,是否有可能在没有循环的情况下遍历列表? 提前谢谢!