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 primary power
Course Downloads
Welcome + Introduction (6:28)
Using Teachable to View the Course (5:25)
Source code
Community Access
Chapter 1: Getting Started with pytest
Intro (0:23)
Installing pytest (3:18)
Our first tests (0:53)
Running pytest (5:21)
Test discovery (2:11)
Test outcomes (4:54)
Chapter 2: Writing Test Functions
Intro (3:40)
Installing cards (3:01)
Playing with cards (3:10)
The cards.Card dataclass (4:34)
Writing Knowledge-Building Tests (4:41)
Running Tests (1:32)
Check Your Setup (2:13)
Bonus: Running Tests in PyCharm (2:45)
Using assert Statements (6:25)
Failing with pytest.fail() and exceptions (3:11)
Writing Assertion Helper Functions (2:58)
Testing for Expected Exceptions (5:25)
Structuring Test Functions (2:54)
Grouping Tests with Classes (6:44)
Running a Subset of Tests (5:23)
Bonus: Virtual Environment functions create/activate/exit for bash/zsh (5:38)
Chapter 3: pytest Fixtures
Intro (1:00)
Visualizing Fixtures (3:24)
Testing the cards API (2:02)
Using Fixtures for Setup and Teardown (5:20)
Tracing Fixture Execution with --setup-show and -s (1:30)
Seeing print output with -s (3:34)
Specifying Fixture Scope (4:06)
Sharing Fixtures through conftest.py (2:13)
Finding Where Fixtures are Defined (3:18)
Intermission 1 (1:48)
Using Multiple Fixture Levels (5:40)
Using Multiple Fixtures per Test (5:09)
Intermission 2 (0:35)
Deciding Fixture Scope Dynamically (3:46)
Using autouse Fixtures (3:38)
Renaming Fixtures (2:35)
Chapter 4: Builtin Fixtures
Intro (1:54)
Using tmp_path and tmp_path_factory (8:23)
Using capsys (4:23)
Output capture with Typer (2:42)
Disabling output capture with capsys (2:54)
The problem with a live db (2:39)
Cards internals (1:47)
Looking at monkeypatch docs (1:10)
Patching get_path (2:40)
Patching pathlib.Path.home (3:47)
Patching an environment variable (0:46)
Design for Testability (1:57)
Chapter 5: Parameterization
Intro (0:24)
Running "cards finish" on the Command Line (1:25)
Looking at the "finish()" API Function (0:33)
Testing Without Parametrize (3:51)
Combining Tests with a Loop (1:31)
Parametrizing Functions (3:13)
Only Parametrizing Meaningful Changes (2:04)
Parametrizing Fixtures (3:56)
What is a Hook Function (1:27)
Parametrizing with pytest_generate_tests (4:11)
Using Keywords to Select Test Cases (2:30)
Chapter 6: Markers
Intro (0:40)
Skipping Tests with pytst.mark.skip (3:57)
Skipping Tests Conditionally with pytst.mark.skipif (4:08)
Expecting Tests to Fail with pytest.mark.xfail (8:03)
Bad Reasons to Use xfail (1:11)
Selecting Tests with Custom Markers (5:17)
Marking Files, Classes, and Parameters (3:42)
Running marked tests with -m (1:24)
Using and, or, not, and Parentheses with Markers and -m (2:36)
Being Strict with Markers (2:51)
Listing Markers with --markers (1:16)
Combining Markers with Fixtures (8:01)
Running "cards finish" on the Command Line
Lesson content locked
If you're already enrolled,
you'll need to login
.
Enroll in Course to Unlock