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
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
Requirements
  • Some experience with Python. Any testing exposure is good but not a requirement
Description

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
00:35
Set up and use virtualenv
01:15
Install packages and dependencies
01:14
Setup Visual Studio Code
01:30
Setup and Use Vim
01:06
Setup Makefile
01:44
Setup ZSH/Bash
00:41
Using Cloud-based development environments
00:38

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
03:54

How Directory conventions work.

Conventions and automatic discovery
11:08

Learn about test functions.

Test Functions
08:21

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

Files, Functions, Classes and Methods
05:07

Learn about test classes

Test Classes
08:35

Learn good naming patterns.

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

Learn to write the most simple test possible

Simplest possible test
06:45

A walkthrough of a simple test in Pytest.

Simple Test Walkthrough
04:09

What is so unique about Pytest?

Why is Pytest important?
01:24

Learn to use asserts in Pytest.

Introduction to asserts
05:52

Learn advanced use cases of assert.

Advanced asserts
12:37

Learn the power of assert.

The power of `assert`
04:14

Learn the difference between Pytest vs Unittest.

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

Introduction to the Test Classes section.

Preview 00:20

Introduction to Test Classes

Introduction to Test Classes
01:58

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

Setting up and tearing down
02:19

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
01:15

Learn to generate code coverage reports with Pytest.

Pytest Coverage Reports
00:44
Pytest with Jenkins and JUnit
00:21

Learn about code quality issues.

Code Quality
04:13

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

Linting
01:38

Learn to format your code with Python Black.

Code Formatting with Python Black
00:40

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
01:52

Learn to use a Python debugger.

Using a debugger
02:28

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?
05:50

Introduction to built-in fixtures

Built-in fixtures
09:43

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

Breakdown of built-in fixtures
03:50

Create your own fixtures

Creating new fixtures
10:22

Learn advanced use cases for fixtures.

Advanced fixtures
12:02

Advanced fixture usage article.

Advanced Fixture Usage
04:15

Learn to parametrize.

Parametrizing
14:02

A walkthrough of parameterization.

Parameterization walkthrough
02:07
+ Monkeypatching
8 lectures 43:01

Introduction to Monkeypatching section.

Preview 00:53

Getting started with monkeypatching

Monkeypatching getting started
12:43

Learn the proper time and place to monkeypatch.

Why and when to monkeypatch?
02:38

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

The simplest monkeypatching
02:40

Advanced Monkeypatching

Advanced Monkeypatching
10:37

Alternate forms of patching

Alternate patching techniques
07:55

Learn how to perform automatic global monkeypatching.

Automatic global monkeypatching
02:03

Learn when not to monkeypatch.

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

Introduction to Tox section.

Preview 01:09
What is tox?
02:39

Getting started with Tox.

Tox getting started
11:38
Testing different Python versions
02:44

Learn advanced techniques with Tox.

Tox advanced techniques
12:19

Learn to expand the Tox test matrix.

Expanding the matrix with different requirement versions
04:21

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

Linting and other validations
02:08