I want to know how can I iterate over a test_funtion() in pytest for different values? Eg.
list = ['ls','ps', 'df' ,'du'] #list of Linux commands
def test_method(self):
for I in list:
r=subprocess.check_output(I)
if r:
assert True
else:
assert False
Now when I run pytest -k test_method, It shows me only one test case passed. But I want all 4 cases ran using single function and need 4 test cases passed in output. How can I achieve it?