Workshop: Introduction to Testing in Python
summary
Workshop builds a credit card validator, fixes real bugs and adds unit tests that actually assert behavior rather than restating the topic, using pytest for discovery and parameterization, unittest.mock and requests‑mock to avoid network flakiness, and coverage.py to report which lines never run. The code is refactored to separate input/output from logic so tests are deterministic, tests catch issuer and length errors, and mocked API responses let API‑dependent checks run reliably.
AI-written summary · about
chapters (31)
- 0:00Start
- 0:09Welcome to Introduction to Testing in Python
- 6:07Naive Testing
- 6:49Test Functions
- 7:09Test Runner
- 7:47Step Five We Will See How To Write Test Case Classes
- 8:09Parametrizing Your Tests
- 9:56To Refactor Your Code for Testing
- 11:42Clone the Repo
- 12:38Table of Contents
- 12:58Business Logic
- 15:07Mirror Mode
- 25:28Extract a Method
- 27:12Refactor Rename
- 29:58Install a Prerequisite
- 30:28Install Pi Test
- 39:06Changing the Directory Recursion
- 39:16Naming Conventions
- 42:30Commit
- 45:47Step 4
- 1:05:58Length Check
- 1:24:50Step 6
- 1:28:39Test Identification
- 1:32:23Step 7
- 1:36:00What Is a Mock
- 1:42:22Backstory of this Api
- 1:49:11Api in Action
- 1:55:57Requests Mock
- 2:01:38Refactoring Your Code
- 2:15:14Step 9
- 2:19:31Things To Remember
related talks
52mTDD for Testers workshop
01h 29mAdv. Software Testing for Data Scientists
24mTesting Your Python Code
31mWorkshop 1: Automate Your QA - Workshop on Behave a BDD
38mTesting for the Terrified: How to Write Tests, Conquer Guilt, and Level Up
01h 23mPython Testing Fundamentals
27mEmpathetic testing: Developing with compassion and humility
32mTest faster, fix more
