Corso
Introduzione al Testing in Python
AvanzatoLivello di competenza
Aggiornato 06/2025Inizia Il Corso Gratis
Incluso conPremium or Team
PythonProgramming4 h16 video53 Esercizi4,350 XP23,636Attestato di conseguimento
Crea il tuo account gratuito
o
Continuando, accetti i nostri Termini di utilizzo, la nostra Informativa sulla privacy e che i tuoi dati siano conservati negli Stati Uniti.Preferito dagli studenti di migliaia di aziende
Vuoi formare 2 o più persone?
Prova DataCamp for BusinessDescrizione del corso
Perché i test?
Un sacco di gente scrive codice. Alcuni riescono a farlo funzionare e a renderlo redditizio. Ma a volte, anche i programmatori più bravi e in gamba fanno errori che possono costare un sacco di soldi. Come ridurre la possibilità di finire in un pasticcio del genere? Come fai a essere sicuro di creare un programma che faccia proprio quello che vuoi? La risposta è super semplice: fai dei test!Nozioni di base sui test in Python
Durante questo percorso imparerai le basi della creazione di test in Python. Incontrerai quattro tipi di metodi di test del software. Creerai i tuoi test per controllare se il programma o una pipeline di dati funzionano come dovrebbero prima di passare alla produzione. Che si tratti di un valore nullo inaspettato, di un errore di battitura nel tuo set di dati o di segni confusi nell'equazione. Puoi farlo, e riuscirai a individuare questi casi con i test.Test con pytest e unittest
Dopo aver finito il corso, conoscerai i diversi tipi di metodi di test e potrai scegliere quelli più adatti a un contesto specifico. Potrai anche progettare questi test e metterli in pratica in Python usando le librerie `pytest` e `unittest`.Prerequisiti
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.
Introduzione al Testing in Python
Corso completato
Ottieni Attestato di conseguimento
Aggiungi questa certificazione al tuo profilo LinkedIn, al curriculum o al CVCondividila sui social e nella valutazione delle tue performance
Incluso conPremium or Team
Iscriviti OraUnisciti a oltre 19 milioni di studenti e inizia Introduzione al Testing in Python oggi!
Crea il tuo account gratuito
o
Continuando, accetti i nostri Termini di utilizzo, la nostra Informativa sulla privacy e che i tuoi dati siano conservati negli Stati Uniti.