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
Release history Release notifications | RSS feed
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
Close
Hashes for flake8-useless-assert-0.4.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23e52d15f27467a5bf71c9f1f3a22ad4a6affabe6ea29fe94254dd325f5f3e61 |
|
MD5 | 6f697ce8107988de6f19e76d8db1bca8 |
|
BLAKE2b-256 | 997b50ca2dbd01dd0e7a5f2c2bfa601cd735506a7abd760c6ad00dd540d3191d |
Close
Hashes for flake8_useless_assert-0.4.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fafa53cf788f546df81d66a52a40476abc25a8707a40cc43b7e65f9a8b080c0 |
|
MD5 | 032393ffe8c83d55cefa95d96e6dfb88 |
|
BLAKE2b-256 | ce0df9a5117fb2026f0057907aada89bd676806f1635ba354420d949951adf9f |