Entries published on December 9, 2023
Use unittest’s subtest helper
This is part of a series of posts I’m doing as a sort of Python/Django Advent calendar, offering a small tip or piece of information each day from the first Sunday of Advent through Christmas Eve. See the first post for an introduction.
Python testing frameworks
The Python standard library ships with the unittest
module for writing tests. The first thing I want to mention about it is that it gets a lot of hate it doesn’t necessarily deserve. Often, the API of unittest
is criticized for being “un-Pythonic”, especially for its use of method names like setUp()
or …