small medium large xlarge

02 Dec 2017, 08:13
Herbert Beemster (1 post)


First and foremost: excellent book!

On page 46 there is an example how to pass ids into a parametrize decorator, a task_ids was created for this. A more lazy solution is to pass repr as an ids as this argument can be a string or a callable:

@pytest.mark.parametrize(‘task’, tasks_to_try, ids=repr)

def test_add_5(task):

Result is pretty much similar:[Task(summary=’sleep’, owner=None, done=True, id=None)] PASSED [ 20%]


You must be logged in to comment