Learn how professional Python is kept correct and shippable — writing pytest tests with fixtures and parametrisation, driving design with TDD and coverage, enforcing PEP 8 with black, flake8 and mypy, and packaging your code with virtual environments and pyproject.toml. These are core skills for the Python Institute PCPP certification and for any developer who ships real software.
Watch the free preview
Writing your first pytest tests — free to watch, no account needed.
What you'll learn
- Write and run automated tests with pytest, including fixtures and parametrised cases
- Apply the test-driven development cycle and measure test coverage
- Enforce PEP 8 style automatically with black and flake8
- Add type hints and verify them with mypy
- Package a project with a virtual environment, requirements.txt and pyproject.toml
Syllabus
Testing with pytest
Writing your first pytest testsFree preview
Fixtures, parametrize and testing exceptions
Test-Driven Development & Coverage
The TDD cycle — red, green, refactor
Measuring coverage and writing testable code
Code Style, Linting & Type Checking
PEP 8, black and flake8
Type hints and mypy
Environments & Packaging
Virtual environments, pip and requirements.txt
Packaging with pyproject.toml
Lab — 10 Programming Exercises & Solutions
Programming Exercises 1–5
Programming Exercises 6–10