- Verifique se os pacotes pytest, pytest-testdox e/ou pytest-django estão instalados globalmente em seu sistema:
pip list
- Caso eles apareçam na listagem, rode os comandos abaixo para realizar a desinstalação:
pip uninstall pytest pytest-testdox pytest-django -y
- Após isso, crie seu ambiente virtual:
python -m venv venv
- Ative seu ambiente virtual:
# Linux e Mac:
source venv/bin/activate
# Windows (PowerShell):
.\venv\Scripts\activate
# Windows (GitBash):
source venv/Scripts/activate
- Instale as bibliotecas necessárias:
pip install pytest-testdox pytest-django
Tarefa 1:
pytest --testdox -vvs tests/tarefas/tarefa_1/
Tarefa 3
pytest --testdox -vvs tests/tarefas/tarefa_3/
Tarefa 4
pytest --testdox -vvs tests/tarefas/tarefa_4/
Você também pode rodar cada método de teste isoladamente:
pytest --testdox -vvs caminho/para/o/arquivo/de/teste::NomeDaClasse::nome_do_metodo_de_teste
Exemplo: executar somente "test_can_list_pets_with_pagination".
pytest --testdox -vvs tests/tarefas/tarefa_3/test_views.py::PetViewsTest::test_can_list_pets_with_pagination
Para executar todos os testes:
pytest --testdox -vvs
Não existem testes isolados para a tarefa 2. As funcionalidades que devem ser testadas desta tarefa estão presentes nos testes da tarefa 3.