Skip to main content

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

assert-info-0.2.1.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

assert_info-0.2.1-py2.py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page