Testing and Continuous Integration

Learning PathSkills: Unit Testing, Doctest, Mock Object Library, Pytest, Continuous Integration, Docker, Code Quality, Test Automation, Software Testing, CI/CD

A person in a white coat with big glasses holding a computer next to a machine that shows big signs reading fail and pass

Embark on a journey to Python testing excellence with Real Python. Begin with fundamental testing concepts, progress through unittest, doctest, mock objects, and Pytest. Conclude with advanced continuous integration practices using Docker. Perfect your skills step-by-step.

Testing and Continuous Integration

Learning Path ⋅ 7 Resources

Title image for Test-Driven Development With pytest (Getting Started With Testing in Python)

Course

Test-Driven Development With pytest

In this hands-on course, you’ll see how to create Python unit tests, execute them, and find the bugs before your users do. You’ll learn about the tools available to write and execute tests, check your application’s performance, and even look for security issues.

Title image for Python's doctest: Document and Test Your Code at Once (Python's doctest: Document and Test Your Code at Once)

Tutorial

Python's doctest: Document and Test Your Code at Once

Learn how to add usage examples to your code's documentation and docstrings and how to use these examples to test your code. To run your usage examples as automated tests, you'll use Python's doctest module from the standard library.

Title image for Python's unittest: Writing Unit Tests for Your Code (Python's unittest: Writing Unit Tests for Your Code)

Tutorial

Python's unittest: Writing Unit Tests for Your Code

Learn how to use the unittest framework to create unit tests for your Python code. Along the way, you'll also learn how to create test cases, fixtures, test suites, and more.

Title image for Improve Your Tests With the Python Mock Object Library (Understanding the Python Mock Object Library)

Course

Improve Your Tests With the Python Mock Object Library

Learn how to use the Python mock object library, unittest.mock, to create and use mock objects to improve your tests. Obstacles like complex logic and unpredictable dependencies make writing valuable tests difficult, but unittest.mock can help you overcome these obstacles.

Title image for Testing Your Code With pytest (Effective Python Testing With Pytest)

Course

Testing Your Code With pytest

Learn how to take your testing to the next level with pytest. You'll cover intermediate and advanced pytest features such as fixtures, marks, parameters, and plugins. With pytest, you can make your test suites fast, effective, and less painful to maintain.

Title image for Continuous Integration With Python (Continuous Integration with Python: An Introduction)

Course

Continuous Integration With Python

Learn the core concepts behind Continuous Integration (CI) and why they are essential for modern software engineering teams. Find out how to how set up Continuous Integration for your Python project to automatically create environments, install dependencies, and run tests.

Title image for Build Robust Continuous Integration With Docker and Friends (Build Robust Continuous Integration With Docker and Friends)

Tutorial

Build Robust Continuous Integration With Docker and Friends

In this tutorial, you'll use Docker and GitHub Actions to build a robust continuous integration pipeline for a multi-container web application consisting of Flask and Redis. Along the way, you'll learn how to dockerize a Python web application.

Got feedback on this learning path?

Looking for real-time conversation? Visit the Real Python Community Chat or join the next “Office Hours” Live Q&A Session. Happy Pythoning!

« Browse All Learning Paths