Testing and Continuous Integration (Learning Path) – Real Python
Learning Path ⋅ Skills: Unit Testing, Doctest, Mock Object Library, Pytest, Continuous Integration, Docker, Code Quality, GitHub Actions, Software Testing, CI/CD
You’ll start with testing fundamentals using unittest and doctest, then explore Python’s mock object library and pytest. From there, you’ll learn about code quality best practices and tools before setting up continuous integration pipelines with GitHub Actions and Docker.
Testing and Continuous Integration
Learning Path ⋅ 9 Resources
Testing Fundamentals
Get an overview of testing in Python. You’ll learn the basics of test-driven development and how to use unittest and doctest to write and organize your tests.
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.
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.
Mock Objects and pytest
Learn how to use Python’s mock object library to isolate your code during testing. Then explore pytest, a popular testing framework that simplifies writing and running tests.
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.
Code Quality
Writing tests is just one part of maintaining a healthy codebase. Learn about tools and best practices for measuring and improving your Python code quality.
Tutorial
Python Code Quality: Best Practices and Tools
Learn about code quality and the key factors that make Python code high-quality. You'll explore effective strategies, powerful tools, and best practices to elevate your code to the next level.
Continuous Integration
Put your testing skills into practice by setting up automated pipelines. You’ll learn how to configure continuous integration with GitHub Actions and Docker.
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.
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.
Congratulations on completing this learning path! You’ve learned how to test Python code with unittest, doctest, pytest, and mock objects, and how to set up continuous integration pipelines.
You’ve also completed the Python Core Intermediate section. Nice work! Your next step is the advanced level:
Learning Path
Concurrency and Async Programming
9 Resources ⋅ Skills: Python, Concurrency, Async IO, Global Interpreter Lock, Thread Safety, Parallel Processing, Performance Optimization, Multithreading, Code Efficiency
You might also be interested in these related learning paths: