Date: May 5, 2025
Want to make your code more reliable and easier to maintain? Writing tests is a crucial skill for any Python coder. In this workshop, you'll learn the fundamentals of testing in Python, including how to write unit tests, use pytest, and implement test-driven development principles. We'll cover best practices for writing effective tests and how to use testing tools to catch bugs.
Participants should be familiar with Python at the level of the Python Fundamentals Bootcamp, another introductory Python workshop, or be a self-taught Python coder. Basic knowledge of Python functions and modules is required.
- Introduction to Testing (10 min)
- Getting Started with pytest (15 min)
- Writing Effective Test Cases (15 min)
- Test-Driven Development (TDD) in Practice (15 min)
- Q&A and Wrap-up (5 min)
Workshop slides and code examples are available in this repository:
presentation.qmd- Quarto presentation slidesexamples/- Directory containing code examples and exercisessolutions/- Directory containing solution code for exercises