I want to name the test dynamically during run-time when i run them with the @pytest.mark.parametrize("value",values_list)
fixture.
for example:
values_list=['apple','tomatoes','potatoes']
@pytest.mark.parametrize("value",values_list)
def test_xxx(self,value):
assert value==value
the final outcome i want to see is 3 tests with the following names:
test_apple
test_tomatoes
test_potatoes
i gave tried looking in to pytest documentation but i haven found anything that might shed light on this problem.
parametrize
values by settingids
arguments. Take a look at docs.pytest.org/en/latest/example/… (testtest_timedistance_v1
). You can customize the value displayed in square brackets during test run. – Hawthorn