A tool for fixing bare assert statements
Assert Info fixes up bare assert statements in your code so they include diagnostics when they they’re hit.
A problem that crops up when working in legacy code bases is the use of assert X == Y, when this fails you get minimal diagnostics.
Whilst Pytest solves this by playing with AST at run time, inserting diagnostics on the fly, you can’t just run all your code with Pytest.
The standard libraries unittest solves this problem with helper functions that include extra diagnostics by default, for instance assertEqual.
This package will inspect any file and replace assert statement which aren’t accompanied by a message with a unittest style assertion so that when it fails you get diagnostics!
To run the script:
pip install assert-info assert-info -h
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size assert_info-0.2.1-py2.py3-none-any.whl (5.5 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size assert-info-0.2.1.tar.gz (4.8 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for assert_info-0.2.1-py2.py3-none-any.whl