Auto add numbers
Now you will practice declaring autouse. At the start, you have an empty Python list. And there is a function that adds some elements to it. Add autouse to the add_numbers_to_list() fixture function, so you could use it without explicitly requesting from the test function. And finally complete the assertion tests by checking if 1 is in init_list and if 9 is in init_list.
This exercise is part of the course
Introduction to Testing in Python
Hands-on interactive exercise
Turn theory into action with one of our interactive exercises
Start Exercise