A tool for fixing bare assert statements
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file assert-info-0.2.1.tar.gz
.
File metadata
- Download URL: assert-info-0.2.1.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.6.9 Linux/5.3.0-46-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63d41ffee4bb6a1a284b7c077f64cac3e203f376458060ddaba8c9d497640823 |
|
MD5 | a59089f0b900a43f63638e09428fe6bf |
|
BLAKE2b-256 | 9d1f3b2d977b6a3dc1b45fad6a0e2fc3873d5ebab19289157d8241162a9fa775 |
File details
Details for the file assert_info-0.2.1-py2.py3-none-any.whl
.
File metadata
- Download URL: assert_info-0.2.1-py2.py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.5 CPython/3.6.9 Linux/5.3.0-46-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9ab6a6c05e230f0e713cd244ce9439ecabd54ef6cd45859e33ccb1be0967aae |
|
MD5 | e13f2dfd17a1dcae8ae0d352087d4ae7 |
|
BLAKE2b-256 | 2e0396c32abed08ac7e04a23d23639f9e269115b22e8d0cb94f05aa0d321394d |