Course
Introduction to Testing in Python
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.Loved by learners at thousands of companies
Training a Team?
Try for BusinessCourse Description
Why tests?
Plenty of people write code. Some of them make it work and profitable. But sometimes, even the smartest of the best programmers makes a mistake that can cost millions of dollars. How to decrease the possibility of getting into such a fiasco? How do you ensure that you create a program that does exactly what you want? The very simple answer is: write tests!Python testing basics
During this journey, you will learn the very basics of creating tests in Python. You will meet four types of software testing methods. You will create your own tests to check if the program or a data pipeline works as expected before it goes to production. Whether it is the unexpected null, a typo in your dataset, or mixed-up signs in the equation. You can, and you will catch those cases with the tests.Testing with pytest and unittest
After the course completion, you will know the types of testing methods, and you will be able to choose the most suitable ones for a specific context. You also will be able to design those tests and implement them in Python using the `pytest` and the `unittest` libraries.Prerequisites
Writing Functions in PythonSoftware Engineering Principles in PythonCreating Tests with pytest
Pytest Fixtures
Basic Testing Types
Writing tests with unittest
Complete
Earn Statement of Accomplishment
Add this credential to your LinkedIn profile, resume, or CVShare it on social media and in your performance reviewEnroll Now
FAQs
Which testing frameworks does this course cover?
You will work with both pytest and unittest. The course covers pytest fixtures, markers, and CLI usage, then introduces unittest assertion methods, fixtures, and test organization.
What types of software testing will I learn to distinguish?
The course covers four testing types, including unit tests and integration tests. You will learn when to apply each type and how to design appropriate test cases for different contexts.
Do I need experience with software engineering concepts before enrolling?
Yes. Prerequisites include Introduction to Functions in Python, Python Toolbox, Writing Functions in Python, and Software Engineering Principles in Python.
Will I learn how to test data pipelines specifically?
Yes. The final chapter on unittest includes practical examples of testing data pipelines, so you can validate that your pipeline produces correct output before it reaches production.
What are pytest fixtures, and why should I learn about them?
Fixtures set up reusable test preconditions like sample data or database connections. Learning them simplifies your test code and helps prevent failures through proper teardown procedures.
Join over 19 million learners and start Introduction to Testing in Python today!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.Grow your data skills with DataCamp for Mobile
Make progress on the go with our mobile courses and daily 5-minute coding challenges.