Testing In Python
3.5 (8 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
204 students enrolled

Testing In Python

Robust Testing For Professionals
3.5 (8 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
204 students enrolled
Last updated 7/2020
English [Auto]
Current price: $129.99 Original price: $199.99 Discount: 35% off
14 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 4.5 hours on-demand video
  • 50 articles
  • Full lifetime access
  • Access on mobile and TV
  • Assignments
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Everything to get started with Python testing, from the basics, to some advanced insights
  • How to setup a cloud-based development environment
  • Core DevOps principles in Python
  • Some experience with Python. Any testing exposure is good but not a requirement

Noah and Alfredo have decades of experience testing with Python in major production environments.  They are the authors of the book Testing in Python and Python for DevOps (O'Reilly). Learn from the best on how to get started and advance your automation with easy examples and code to follow up. 

  • Introduction

    • Why test at all?

    • Leveling up from simple scripts to robust implementations

    • Python, Pytest, Tox supported versions

  • Configuring the environment

    • Setting up and using Git

    • Setting up and using Virtualenv

    • Installing packages and dependencies

    • Setup Visual Code code

    • Setup and use Vim

    • Setup Makefile

    • Setup and Use ZSH/Bash

    • Using Cloud-based development environments

  • Testing Conventions

    • Directories

    • Files

    • Functions, Classes, and test methods

    • Special test class methods

    • Good naming patterns

  • Introduction to Pytest

    • The most simple test possible

    • Why is Pytest important?

    • The power of assert

    • Pytest vs. Unittest

  • Test Classes

    • Setting up and teardown of xunit-style tests

  • Reporting

    • PyTest Reporting

    • Code Quality

    • Linting

    • Code Formatting with Python Black

  • Debugging with Pytest

    • How to debug code

    • Using a debugger

    • Python Debugger (PDB) integration

  • Pytest fixtures and plugins

    • What are fixtures?

    • Creating new fixtures

    • Built-in Fixtures

    • Advanced Fixture usage

    • Parametrizing

  • Monkeypatching

    • Why and when to monkeypatch?

    • monkeypatching is hard

    • The simplest monkeypatching

    • Automatic and global monkeypatching

    • Other patching

    • When not to monkeypatch

  • Testing matrix with Tox

    • Testing different Python versions

    • Expanding the testing matrix

    • Linting and other validations

  • Continuous Integration and Continuous Delivery

    • What is Continuous Integration and Continuous Delivery and Why Do They Matter?

    • Jenkins

    • CircleCI

    • GCP Cloud Build

    • Continuous Delivery for Hugo Static Site from Zero using AWS Code Pipeline

    • Github Actions

  • Case Studies and War Stories

    • Testing Click Commandline Tools

    • War Story: The Health Check that wasn’t wrong

    • War Story: The Nine Circles of Hell While Parsing XML

    • War Story: The Mysterious Vanishing Servers

  • Essays

    • Writing clean, testable, high-quality code in Python

    • Increase reliability in data science and machine learning projects with CircleCI

    • Data science project quality

  • Conclusion

    • Create a final portfolio project

Who this course is for:
  • Python developers, college students, DevOps engineers, and data scientists
Course content
Expand all 85 lectures 06:57:40
+ Course Introduction
1 lecture 01:26

Introduction to the course by co-author Noah Gift

Preview 01:26
+ Configuring Environment
11 lectures 50:06

An introduction to Configuring Environment section.

Preview 00:40

Learn to set up an AWS Cloud9 based development from scratch.

Preview 21:29
Setting up and using Git and Github
Set up and use virtualenv
Install packages and dependencies
Setup Visual Studio Code
Setup and Use Vim
Setup Makefile
Setup ZSH/Bash
Using Cloud-based development environments

In this screencast learn how to setup Docker in a Cloud-based development environment.  Also, learn about some of the pitfalls of a Cloud-based environment.

Preview 19:11

Test your knowledge about configuring your development environment.

Quiz: Configuring Environment
3 questions
+ Testing conventions
7 lectures 40:28

Introduction to Testing conventions.

Preview 00:41

Learn how to layout tests.

Directory layouts

How Directory conventions work.

Conventions and automatic discovery

Learn about test functions.

Test Functions

Learn to master key elements of tests: Files, Functions, Classes, and Methods.

Files, Functions, Classes and Methods

Learn about test classes

Test Classes

Learn good naming patterns.

Good naming Patterns
+ Introduction to Pytest
8 lectures 36:58

Learn to write the most simple test possible

Simplest possible test

A walkthrough of a simple test in Pytest.

Simple Test Walkthrough

What is so unique about Pytest?

Why is Pytest important?

Learn to use asserts in Pytest.

Introduction to asserts

Learn advanced use cases of assert.

Advanced asserts

Learn the power of assert.

The power of `assert`

Learn the difference between Pytest vs Unittest.

Pytest vs. Unittest
+ Test Classes
3 lectures 04:37

Introduction to the Test Classes section.

Preview 00:20

Introduction to Test Classes

Introduction to Test Classes

Learn to set up and tear-down x-unit style tests in using PyTest

Setting up and tearing down

Test your knowledge of the material in this section.

Test Classes
2 questions
+ Pytest Reporting
8 lectures 09:49

Introduction to the Pytest Reporting section.

Preview 00:31

Learn how build servers go beyond just testing.

Preview 00:25

Introduction to Pytest reporting.

Pytest Reporting

Learn to generate code coverage reports with Pytest.

Pytest Coverage Reports
Pytest with Jenkins and JUnit

Learn about code quality issues.

Code Quality

Learn how linting improves code quality by studying Pylint and Flake8.


Learn to format your code with Python Black.

Code Formatting with Python Black

Test your knowledge of reporting.

Quiz: Reporting
2 questions
+ Debugging with Pytest
3 lectures 04:59

Introduction to Debugging section.

Preview 00:38

Learn how to debug code.

How to debug code

Learn to use a Python debugger.

Using a debugger

Test your knowledge of debugging in Python.

Quiz: Debugging
2 questions
+ Pytest fixtures and plugins
9 lectures 01:03:19

Introduction to section on Pytest fixtures and plugins

Preview 01:08

An overview of fixtures.

What are fixtures?

Introduction to built-in fixtures

Built-in fixtures

A breakdown of the built-in fixtures available in Pytest.

Breakdown of built-in fixtures

Create your own fixtures

Creating new fixtures

Learn advanced use cases for fixtures.

Advanced fixtures

Advanced fixture usage article.

Advanced Fixture Usage

Learn to parametrize.


A walkthrough of parameterization.

Parameterization walkthrough
+ Monkeypatching
8 lectures 43:01

Introduction to Monkeypatching section.

Preview 00:53

Getting started with monkeypatching

Monkeypatching getting started

Learn the proper time and place to monkeypatch.

Why and when to monkeypatch?

Learn how to do a "hello world" style monkeypatch.

The simplest monkeypatching

Advanced Monkeypatching

Advanced Monkeypatching

Alternate forms of patching

Alternate patching techniques

Learn how to perform automatic global monkeypatching.

Automatic global monkeypatching

Learn when not to monkeypatch.

When not to monkeypatch
+ Testing matrix with Tox
7 lectures 36:58

Introduction to Tox section.

Preview 01:09
What is tox?

Getting started with Tox.

Tox getting started
Testing different Python versions

Learn advanced techniques with Tox.

Tox advanced techniques

Learn to expand the Tox test matrix.

Expanding the matrix with different requirement versions

Learn how tox works with linting and other forms of code validation.

Linting and other validations