Skip to main content

flake8 plugin to catch useless `assert` statements

Project description

flake8-useless-assert

flake8 plugin to catch useless assert statements

Download or install on the PyPI page

Violations

Code Description Example
ULA001 assert with a truthy literal assert "foo"
assert ...
assert True
ULA002 assert with 0 assert 0
ULA003 assert with None assert None
ULA004 assert with "literal".format(...) assert "foo {0}".format(bar)
ULA005 assert with f-string assert f"foo {bar}"
ULA006 assert with constant computation assert "foo" == "bar" * 3
assert repr("fizz") == "'buzz'"

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.4.4.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

flake8_useless_assert-0.4.4-py3-none-any.whl (5.8 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