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 |
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d3d6c71ea6da313ab1348488757395bd47aad30732920ba2a13af14fb509cdb |
|
MD5 | 16c9d25d995d824ae6c439229a45d763 |
|
BLAKE2b-256 | df984dcd6c73310686e22148d8cc07716b398001cb9dc2a010298c2c355bfb83 |
Close
Hashes for flake8_useless_assert-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72167de770ee602ee78363b089697fcc2335e5d536284cd08dfa9bb8e38f7fd1 |
|
MD5 | dc973648bbeab54ca1b31eca7f1e7059 |
|
BLAKE2b-256 | a6ec51934a32987c454c308f771a8b1e118478f91ff2582ed5d6ac3c6abd4749 |