Skip to Content
Pytest Master Class
on-demand course

Pytest Master Class

with Alfredo Deza, Noah Gift
October 2021
Intermediate
2h 46m
English
Pragmatic AI Labs
Closed Captioning available in German, English, Spanish, French, Italian, Japanese

Overview

Pytest Master Class Full Course

Learn to master testing in Python with Pytest from Five Time O'Reilly Author and AWS ML Hero Noah Gift

Pytest is a testing framework for Python that allows you to write tests in a readable and concise way. This close to three-hour course will teach you how to write tests in Python using Pytest as well as master CI/CD with Pytest. Take your testing and DevOps skills to the next level with this full-course Pytest Master Class.

Topics Covered Include:

  • 00:00 Introduction
  • 03:38 What is DevOps?
  • 05:32 Github CodeSpaces
  • 09:45 Create Python Project Structure: Makefile, requirements.txt, test file and virtualenv
  • 16:33 Importing code with IPython
  • 17:32 Writing tests with Pytest
  • 21:58 Using Pylint
  • 23:56 Verifying Pylint bad syntax catch
  • 25:41 Formatting code with Black
  • 26:38 Pinning requirements to a specific version
  • 30:00 Setup Github Actions
  • 37:38 Matrix Testing multiple versions of a Python 3.6, 3.7, 3.8, 3.9 with Github Actions
  • 50:00 Using AWS CloudShell
  • 53:00 Using AWS Cloud9
  • 54:07 Adding virtualenv to ~/.bashrc
  • 57:24 Using AWS CodeBuild
  • 01:17:01 Testing Google Colab Notebooks and Jupyter Notebooks with nbval and Pytest
  • 01:29:39 Using pdb;pdb.set_trace() and ipdb;ipdb.set_trace()
  • 01:35:53 Using pytest-cov
  • 01:37:47 Using pytest with --pdb pdb debbuging during tests
  • 01:38:12 Using pytest with --pdb --maxfailures 1 to stop after first failure
  • 01:42:20 Using pytest to test a single test
  • 01:49:25 Using Pytest with fixtures
  • 01:56:23 Using Pytest setup_function and teardown_function to setup and teardown of tests
  • 02:00:00 Using flask web framework
  • 02:04:25 Testing flask web framework with pytest
  • 02:10:46 Extending flask with a greedy coin change machine
  • 02:21:27 Using click to create a command line interface
  • 02:30:39 Using Pytest to test click command line interfaces
  • 02:44:42 Matrix testing entire project with click, pytest, and nbval using Github Actions and multiple versions of Python 3.6, 3.7, 3.8, 3.9
Learning Objectives

This course covers the following learning objectives:

  • Learn to master Pytest.
  • Learn to setup CI/CD pipelines with Pytest, Pylint, Python Black Formatting, Github Actions and AWS CodeBuild.
  • Learn to use Cloud-based development environments with Pytest like Githhub CodeSpaces, AWS Cloud9 and AWS CloudShell
  • Learn to create local test environments with Pytest and Virtualenv
  • Learn to use advanced functions like Pytest test selection, pdb (python debugger) and fixtures.
  • Learn to build a realistic problem including libraries, building command-line tools with Click and web frameworks with Flask.
Additional Popular Resources
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Watch now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Elegant Automation Frameworks with Python and Pytest

Elegant Automation Frameworks with Python and Pytest

Brandon Blair
Testing In Python video course

Testing In Python video course

Alfredo Deza, Noah Gift

Publisher Resources

ISBN: 10132021VIDEOPAIMLOtherOtherOther