Approval Utilities

raw JSON →
18.0.1 verified Mon Apr 27 auth: no python

Supporting utilities for approval testing in Python, commonly used with the approvaltests package. Current version 18.0.1, released regularly via GitHub releases. Supports Python 3.10+.

pip install approval-utilities
error ModuleNotFoundError: No module named 'approval_utilities'
cause Package not installed or not upgraded to version that includes 'approval_utilities' module.
fix
Run 'pip install approval-utilities' (or 'pip install --upgrade approval-utilities').
error ImportError: cannot import name 'verify' from 'approval_utilities'
cause The verify function might not be in the top-level of approval_utilities; it's in approval_utilities.utilities.
fix
Change import to 'from approval_utilities.utilities import verify'.
breaking Removed support for Python 3.8 and 3.9 in v18.0.0. These versions are no longer compatible.
fix Upgrade to Python 3.10+ or stay on v17.x if you cannot upgrade Python.
gotcha The package 'approvaltests-minimal' now correctly declares dependency on 'approval_utilities' from v18.0.0 onwards, but older versions might missing the dependency. Install explicitly if needed.
fix Run 'pip install approval-utilities' alongside approvaltests-minimal.
deprecated The verify function imported from approvaltests is deprecated and will be removed in future approvaltests releases. Migrate to approval_utilities.
fix Use 'from approval_utilities.utilities import verify' instead.

Quick example of using LoggerUtilities from approval_utilities.

from approval_utilities.utilities import LoggerUtilities
logger = LoggerUtilities()
logger.log('test')