RANIARANIA Academy

Testing, Packaging & Best Practices

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.

Python: Professional ADVANCED · 150 min · Certificate on completion · 3 CPD points

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 preview15 min
Fixtures, parametrize and testing exceptions15 min
Test-Driven Development & Coverage
The TDD cycle — red, green, refactor15 min
Measuring coverage and writing testable code15 min
Code Style, Linting & Type Checking
PEP 8, black and flake815 min
Type hints and mypy15 min
Environments & Packaging
Virtual environments, pip and requirements.txt15 min
Packaging with pyproject.toml15 min
Lab — 10 Programming Exercises & Solutions
Programming Exercises 1–515 min
Programming Exercises 6–1015 min