Write tests for the todo commands. Replace this with your step instructions.
Instructions
- Install pytest with
python -m pip install pytest - Create
test_todo.pyand test the add and list commands - Run pytest and verify all tests pass
Write the test
pytest runs every function named test_* in files named test_*.py. A plain assert statement reports the failure:
def test_add_todo(): todos = [] todos.append("write tests") assert len(todos) == 1Run the tests:
Terminal
$ python -m pytest
1 passed in 0.01s