# Testing Edge Cases and Errors

Bugs hide at the edges of what a function accepts, so good tests try zero and empty values, the smallest and biggest values allowed and each side of a boundary, make sure bad values are refused with pytest.raises, and run many examples through one test with parametrize.

![Cheat sheet: Testing Edge Cases and Errors](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/dd1b3373545a417aba3639c9945b9de0.webp)

- Category: Python
- Level: Journeyman
- Tags: Boundary Value, Edge Case, Parametrized Test, pytest.raises, python
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/python-testing-edge-cases-and-errors-cheat-sheet
