This course was created with the
course builder. Create your online course today.
Start now
Create your course
with
Autoplay
Autocomplete
Previous Lesson
Complete and Continue
pytest Working with Projects
Course Downloads
Source code
Chapter 7: Strategy
Intro (0:54)
Determining Test Scope (1:32)
Considering Software Architecture (0:35)
Evaluating the Features to Test (1:39)
Creating Test Cases (0:45)
Writing a Test Strategy (1:20)
Cards Example: Scope, Architecture, and Prioritizing Features (3:09)
Cards Example: Creating Test Cases (4:41)
Cards Example: Writing a Test Strategy (0:55)
Cards Example: From Test Cases to Test Code (4:59)
Cards Example: Running the Tests (0:54)
Chapter 8: Configuration Files
Intro (2:19)
Determining a Root Directory (1:57)
Saving Settings and Flags in pytest.ini (5:27)
Using tox.ini, pyproject.toml, or setup.cfg in place of pytest.ini (4:11)
Avoiding Test File Name Collision with __init__.py (5:08)
Chapter 9: Coverage
Intro (1:13)
Measuring Code Coverage with `pytest-cov` (3:02)
Measuring Code Coverage with `coverage` Directly (2:05)
Specifying Multiple Equivalent Source Paths in `.coveragerc` (1:59)
Generating HTML Reports (6:00)
Excluding Code from Coverage (1:57)
Adding the Missing Test Cases (2:48)
Beware of Coverage-Driven Development (2:45)
Running Coverage on Tests (2:34)
Running Coverage on a Directory (2:14)
Running Coverage on a Single File Script (3:48)
Chapter 10: Mocking
Intro (2:12)
What Are We Mocking? Isolating the Cards CLI (4:10)
Testing with Typer + shlex + cards_cli (5:22)
Mocking an Attribute (4:26)
Mocking a Class and Methods (6:56)
Using a Fixture for Mocking (2:30)
Using autospec to Keep Mocks and API Synchronized (3:54)
Making Sure Functions Are Called Correctly (3:42)
Creating Error Conditions (2:12)
Running Coverage + Coverage Exclusion (4:04)
Read the Docs (0:22)
Mocks Don't Test Behavior (1:22)
Testing at Multiple Layers to Avoid Mocking (4:10)
Using Plugins to Assist Mocking (1:03)
Chapter 11: tox and Continuous Integration
Intro (1:53)
Setting Up tox (6:03)
Running tox (2:22)
Testing Multiple Python Versionse (2:36)
Running tox Environments in Parallel (1:11)
Adding a Coverage Report to tox (1:15)
Specifying a Minimum Coverage Level (1:10)
Passing pytest Parameters Through tox (1:31)
Combining pytest.ini and .coveragerc into tox.ini (2:48)
CI: Running tox with GitHub Actions (6:04)
Chapter 12: Testing Scripts and Applications
Intro (1:32)
Testing a Python Script (8:17)
Testing an Importable Python Script (4:30)
Separating Code into src and tests Directories (2:24)
Testing a requirements.txt-based Application (5:05)
Chapter 13: Debugging Test Failures
Intro (2:12)
Setup (4:07)
Writing Tests First (6:39)
First Draft Implementation (3:30)
Debugging with pytest Flags (4:47)
Debugging with pdb (2:36)
Combining tox and pdb (2:23)
Refactoring (4:17)
Note on Code Sample (0:41)
Using tox.ini, pyproject.toml, or setup.cfg in place of pytest.ini
Lesson content locked
If you're already enrolled,
you'll need to login
.
Enroll in Course to Unlock