tests_arr = ['test1','test2']
logs_arr = ['log1','log2']
def List_of_Tests():
tests = tests_arr
return tests
def List_of_Logs():
logs = logs_arr
return logs
@pytest.mark.parametrize("test, log",
[
([i for i in List_of_Tests()], [i for i in List_of_Logs()])
]
)
def methodname(test,log):
print(test+ " " + log)
When I try to pas the list items dynamically, I'm getting the below error
TypeError: expected str, bytes or os.PathLike object, not list
I am not sure what parametrization you want but I guess:
then you should use zip.
But what you are doing looks strange, did you consider using pytest_generate_tests?