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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e80ce47151204801715511872dff2bb2ae8761cb4c5be51adfd895e39180ea38 |
|
MD5 | bdc75ce0ede8a101b760752fd0a2c837 |
|
BLAKE2b-256 | e8d647cd453c727a2b64136371a2f103afd02b8056d8494be86d12a7e0b41dab |
Close
Hashes for flake8_useless_assert-0.4.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 588c0a47ee80b5ac0700e51f4bead28e93a76dd747313470f6fa255f7d5473c9 |
|
MD5 | ea442944b5723b7e5ebe566605b00aaf |
|
BLAKE2b-256 | 2e1161b41d5a29d5b89c6933174bdf3524a3842285621e0ceeb4274d73c53e7c |