Module 09 of 10

Testing & CI/CD

Lessons

About This Module

Code that runs isn't the same as code that works. Automated tests check your program's behavior every time you change it, so you can add features and refactor with confidence instead of crossing your fingers.

You'll start with unit testing using Python's built-in unittest module, then move to pytest, the most popular testing framework in the Python world, with simpler syntax, fixtures, and parametrized tests. Next you'll learn the ideas behind CI/CD (continuous integration and continuous delivery) and how to put them into practice with GitHub Actions, so your tests run automatically on every push.

With tested, automated code behind you, you'll be ready for the final module, Async & Deployment, where you'll learn to write concurrent Python and ship your apps.

Lessons

4 videos
01

Python Tutorial: Unit Testing Your Code with the unittest Module

How to write unit tests with Python's built-in unittest module: test cases, assert methods, setUp and tearDown, and why testing makes refactoring safer.

02

Pytest Tutorial: How to Test Python Code

How to test with pytest: writing your first tests, class-based tests, fixtures, marks and parametrization, and mocking external dependencies.

03

CI/CD Explained

What continuous integration, continuous delivery, and continuous deployment mean, and how a pipeline takes code from a commit to production.

04

GitHub Actions Tutorial - Basic Concepts and CI/CD Pipeline with Docker

How GitHub Actions automates your workflows: events, workflows, and runners, the syntax of a workflow file, and building a complete CI pipeline.