Curso
Introdução aos Testes em Python
AvançadoNível de habilidade
Atualizado 06/2025Iniciar Curso Gratuitamente
Incluído comPremium or Teams
PythonProgramming4 h16 vídeos53 Exercícios4,350 XP23,621Certificado de conclusão
Crie sua conta gratuita
ou
Ao continuar, você aceita nossos Termos de Uso, nossa Política de Privacidade e que seus dados serão armazenados nos EUA.Preferido por alunos de milhares de empresas
Treinar 2 ou mais pessoas?
Experimentar DataCamp for BusinessDescrição do curso
Por que testes?
Muitas pessoas escrevem códigos. Alguns deles fazem com que isso funcione e seja lucrativo. Mas, às vezes, até mesmo o mais inteligente dos melhores programadores comete um erro que pode custar milhões de dólares. Como você pode diminuir a possibilidade de se envolver em um fiasco como esse? Como garantir que você crie um programa que faça exatamente o que você deseja? A resposta muito simples é: escreva testes!Noções básicas de testes em Python
Durante esta jornada, você aprenderá os fundamentos da criação de testes em Python. Você conhecerá quatro tipos de métodos de teste de software. Você criará seus próprios testes para verificar se o programa ou um pipeline de dados funciona conforme o esperado antes de entrar em produção. Seja um nulo inesperado, um erro de digitação em seu conjunto de dados ou sinais confusos na equação. Você pode, e você detectará esses casos com os testes.Testes com pytest e unittest
Após a conclusão do curso, você conhecerá os tipos de métodos de teste e poderá escolher os mais adequados para um contexto específico. Você também será capaz de projetar esses testes e implementá-los em Python usando as bibliotecas `pytest` e `unittest`.Pré-requisitos
Writing Functions in PythonSoftware Engineering Principles in Python1
Creating Tests with pytest
Learn what a test is and how to run the first one of your own with the pytest library! You will get used to the pytest testing framework and the command-line interface. You will also learn how to process specific contexts, like "failed tests" and "skipping the test" with pytest markers.
2
Pytest Fixtures
Learn what a fixture is and how to simplify your code by using it in tests. You will get familiar with the fixture @pytest.fixture decorator and the fixture tools. You will analyze your code to see the "fixture part" in it. Finally, learn how to use teardowns to prevent software failures.
3
Basic Testing Types
Learn what the basic testing types are and their features. Learn about test cases and how they help to implement tests. You will get more skilled with creating test functions and running pytest from CLI in IDE exercises. Finally, you will be able to differentiate the different testing types and create tests for each of them.
4
Writing tests with unittest
In this final chapter, you will meet the unittest framework. First, you will learn basic assertion methods, then its CLI interface, and how to use fixtures. Finally, you will put everything together in the practical examples of data pipelines.
Introdução aos Testes em Python
Curso concluído
Obtenha um certificado de conclusão
Adicione esta credencial ao seu perfil do LinkedIn, currículo ou CVCompartilhe nas redes sociais e em sua avaliação de desempenho
Incluído comPremium or Teams
Inscreva-se AgoraFaça como mais de 19 milhões de alunos e comece Introdução aos Testes em Python hoje mesmo!
Crie sua conta gratuita
ou
Ao continuar, você aceita nossos Termos de Uso, nossa Política de Privacidade e que seus dados serão armazenados nos EUA.