Skip to main content

flake8 plugin to catch useless `assert` statements

Project description

flake8-useless-assert

flake8 plugin to catch useless assert statements

Violations

Code Description Example
ULA001 assert with a literal assert "foo"
assert ...
True
ULA002 assert with a formatted string assert "foo {0}".format(bar)
assert f"foo {bar}"

Note that assert False is exempt from ULA001 because it's a common idiom.

Testing

I haven't set up proper testing yet, but you can run poetry install and then:

flake8 examples/

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

flake8-useless-assert-0.3.1.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

flake8_useless_assert-0.3.1-py3-none-any.whl (4.9 kB view hashes)

Uploaded 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